#!/usr/bin/env python
# -*- coding: utf-8 -*-

__version__ = "0.1.0"

__copyright__ = """
    pyObjUtils - Object file library for Python.

   (C) 2010-2016 by Christoph Schueler <github.com/Christoph2,
                                        cpu12.gems@googlemail.com>

   All Rights Reserved

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""

import enum

from objutils.elf.defs import ELFMachineType


class Relocs68K(enum.IntEnum):

    R_68K_NONE                             = 0    #! No reloc
    R_68K_32                               = 1    #! Direct 32 bit
    R_68K_16                               = 2    #! Direct 16 bit
    R_68K_8                                = 3    #! Direct 8 bit
    R_68K_PC32                             = 4    #! PC relative 32 bit
    R_68K_PC16                             = 5    #! PC relative 16 bit
    R_68K_PC8                              = 6    #! PC relative 8 bit
    R_68K_GOT32                            = 7    #! 32 bit PC relative GOT entry
    R_68K_GOT16                            = 8    #! 16 bit PC relative GOT entry
    R_68K_GOT8                             = 9    #! 8 bit PC relative GOT entry
    R_68K_GOT32O                           = 10   #! 32 bit GOT offset
    R_68K_GOT16O                           = 11   #! 16 bit GOT offset
    R_68K_GOT8O                            = 12   #! 8 bit GOT offset
    R_68K_PLT32                            = 13   #! 32 bit PC relative PLT address
    R_68K_PLT16                            = 14   #! 16 bit PC relative PLT address
    R_68K_PLT8                             = 15   #! 8 bit PC relative PLT address
    R_68K_PLT32O                           = 16   #! 32 bit PLT offset
    R_68K_PLT16O                           = 17   #! 16 bit PLT offset
    R_68K_PLT8O                            = 18   #! 8 bit PLT offset
    R_68K_COPY                             = 19   #! Copy symbol at runtime
    R_68K_GLOB_DAT                         = 20   #! Create GOT entry
    R_68K_JMP_SLOT                         = 21   #! Create PLT entry
    R_68K_RELATIVE                         = 22   #! Adjust by program base
    R_68K_TLS_GD32                         = 25   #! 32 bit GOT offset for GD
    R_68K_TLS_GD16                         = 26   #! 16 bit GOT offset for GD
    R_68K_TLS_GD8                          = 27   #! 8 bit GOT offset for GD
    R_68K_TLS_LDM32                        = 28   #! 32 bit GOT offset for LDM
    R_68K_TLS_LDM16                        = 29   #! 16 bit GOT offset for LDM
    R_68K_TLS_LDM8                         = 30   #! 8 bit GOT offset for LDM
    R_68K_TLS_LDO32                        = 31   #! 32 bit module-relative offset
    R_68K_TLS_LDO16                        = 32   #! 16 bit module-relative offset
    R_68K_TLS_LDO8                         = 33   #! 8 bit module-relative offset
    R_68K_TLS_IE32                         = 34   #! 32 bit GOT offset for IE
    R_68K_TLS_IE16                         = 35   #! 16 bit GOT offset for IE
    R_68K_TLS_IE8                          = 36   #! 8 bit GOT offset for IE
    R_68K_TLS_LE32                         = 37   #! 32 bit offset relative to static TLS block
    R_68K_TLS_LE16                         = 38   #! 16 bit offset relative to static TLS block
    R_68K_TLS_LE8                          = 39   #! 8 bit offset relative to static TLS block
    R_68K_TLS_DTPMOD32                     = 40   #! 32 bit module number
    R_68K_TLS_DTPREL32                     = 41   #! 32 bit module-relative offset
    R_68K_TLS_TPREL32                      = 42   #! 32 bit TP-relative offset
    R_68K_NUM                              = 43


class Relocs386(enum.IntEnum):

    R_386_NONE                             = 0    #! No reloc
    R_386_32                               = 1    #! Direct 32 bit
    R_386_PC32                             = 2    #! PC relative 32 bit
    R_386_GOT32                            = 3    #! 32 bit GOT entry
    R_386_PLT32                            = 4    #! 32 bit PLT address
    R_386_COPY                             = 5    #! Copy symbol at runtime
    R_386_GLOB_DAT                         = 6    #! Create GOT entry
    R_386_JMP_SLOT                         = 7    #! Create PLT entry
    R_386_RELATIVE                         = 8    #! Adjust by program base
    R_386_GOTOFF                           = 9    #! 32 bit offset to GOT
    R_386_GOTPC                            = 10   #! 32 bit PC relative offset to GOT
    R_386_32PLT                            = 11
    R_386_TLS_TPOFF                        = 14   #! Offset in static TLS block
    R_386_TLS_IE                           = 15   #! Address of GOT entry for static TLS block offset
    R_386_TLS_GOTIE                        = 16   #! GOT entry for static TLS block offset
    R_386_TLS_LE                           = 17   #! Offset relative to static TLS block
    R_386_TLS_GD                           = 18   #! Direct 32 bit for GNU version of general dynamic thread local data
    R_386_TLS_LDM                          = 19   #! Direct 32 bit for GNU version of local dynamic thread local data in LE code
    R_386_16                               = 20
    R_386_PC16                             = 21
    R_386_8                                = 22
    R_386_PC8                              = 23
    R_386_TLS_GD_32                        = 24   #! Direct 32 bit for general dynamic thread local data
    R_386_TLS_GD_PUSH                      = 25   #! Tag for pushl in GD TLS code
    R_386_TLS_GD_CALL                      = 26   #! Relocation for call to __tls_get_addr()
    R_386_TLS_GD_POP                       = 27   #! Tag for popl in GD TLS code
    R_386_TLS_LDM_32                       = 28   #! Direct 32 bit for local dynamic thread local data in LE code
    R_386_TLS_LDM_PUSH                     = 29   #! Tag for pushl in LDM TLS code
    R_386_TLS_LDM_CALL                     = 30   #! Relocation for call to __tls_get_addr() in LDM code
    R_386_TLS_LDM_POP                      = 31   #! Tag for popl in LDM TLS code
    R_386_TLS_LDO_32                       = 32   #! Offset relative to TLS block
    R_386_TLS_IE_32                        = 33   #! GOT entry for negated static TLS block offset
    R_386_TLS_LE_32                        = 34   #! Negated offset relative to static TLS block
    R_386_TLS_DTPMOD32                     = 35   #! ID of module containing symbol
    R_386_TLS_DTPOFF32                     = 36   #! Offset in TLS block
    R_386_TLS_TPOFF32                      = 37   #! Negated offset in static TLS block
    R_386_SIZE32                           = 38   #! 32-bit symbol size
    R_386_TLS_GOTDESC                      = 39   #! GOT offset for TLS descriptor.
    R_386_TLS_DESC_CALL                    = 40   #! Marker of call through TLS descriptor for relaxation.
    R_386_TLS_DESC                         = 41   #! TLS descriptor containing pointer to code and to argument, returning the TLS offset for the symbol.
    R_386_IRELATIVE                        = 42   #! Adjust indirectly by program base
    R_386_GOT32X                           = 43   #! Load from 32 bit GOT entry, relaxable.
    R_386_NUM                              = 44


class RelocsSparc(enum.IntEnum):

    R_SPARC_NONE                           = 0    #! No reloc
    R_SPARC_8                              = 1    #! Direct 8 bit
    R_SPARC_16                             = 2    #! Direct 16 bit
    R_SPARC_32                             = 3    #! Direct 32 bit
    R_SPARC_DISP8                          = 4    #! PC relative 8 bit
    R_SPARC_DISP16                         = 5    #! PC relative 16 bit
    R_SPARC_DISP32                         = 6    #! PC relative 32 bit
    R_SPARC_WDISP30                        = 7    #! PC relative 30 bit shifted
    R_SPARC_WDISP22                        = 8    #! PC relative 22 bit shifted
    R_SPARC_HI22                           = 9    #! High 22 bit
    R_SPARC_22                             = 10   #! Direct 22 bit
    R_SPARC_13                             = 11   #! Direct 13 bit
    R_SPARC_LO10                           = 12   #! Truncated 10 bit
    R_SPARC_GOT10                          = 13   #! Truncated 10 bit GOT entry
    R_SPARC_GOT13                          = 14   #! 13 bit GOT entry
    R_SPARC_GOT22                          = 15   #! 22 bit GOT entry shifted
    R_SPARC_PC10                           = 16   #! PC relative 10 bit truncated
    R_SPARC_PC22                           = 17   #! PC relative 22 bit shifted
    R_SPARC_WPLT30                         = 18   #! 30 bit PC relative PLT address
    R_SPARC_COPY                           = 19   #! Copy symbol at runtime
    R_SPARC_GLOB_DAT                       = 20   #! Create GOT entry
    R_SPARC_JMP_SLOT                       = 21   #! Create PLT entry
    R_SPARC_RELATIVE                       = 22   #! Adjust by program base
    R_SPARC_UA32                           = 23   #! Direct 32 bit unaligned
    R_SPARC_PLT32                          = 24   #! Direct 32 bit ref to PLT entry
    R_SPARC_HIPLT22                        = 25   #! High 22 bit PLT entry
    R_SPARC_LOPLT10                        = 26   #! Truncated 10 bit PLT entry
    R_SPARC_PCPLT32                        = 27   #! PC rel 32 bit ref to PLT entry
    R_SPARC_PCPLT22                        = 28   #! PC rel high 22 bit PLT entry
    R_SPARC_PCPLT10                        = 29   #! PC rel trunc 10 bit PLT entry
    R_SPARC_10                             = 30   #! Direct 10 bit
    R_SPARC_11                             = 31   #! Direct 11 bit
    R_SPARC_64                             = 32   #! Direct 64 bit
    R_SPARC_OLO10                          = 33   #! 10bit with secondary 13bit addend
    R_SPARC_HH22                           = 34   #! Top 22 bits of direct 64 bit
    R_SPARC_HM10                           = 35   #! High middle 10 bits of ...
    R_SPARC_LM22                           = 36   #! Low middle 22 bits of ...
    R_SPARC_PC_HH22                        = 37   #! Top 22 bits of pc rel 64 bit
    R_SPARC_PC_HM10                        = 38   #! High middle 10 bit of ...
    R_SPARC_PC_LM22                        = 39   #! Low miggle 22 bits of ...
    R_SPARC_WDISP16                        = 40   #! PC relative 16 bit shifted
    R_SPARC_WDISP19                        = 41   #! PC relative 19 bit shifted
    R_SPARC_GLOB_JMP                       = 42   #! was part of v9 ABI but was removed
    R_SPARC_7                              = 43   #! Direct 7 bit
    R_SPARC_5                              = 44   #! Direct 5 bit
    R_SPARC_6                              = 45   #! Direct 6 bit
    R_SPARC_DISP64                         = 46   #! PC relative 64 bit
    R_SPARC_PLT64                          = 47   #! Direct 64 bit ref to PLT entry
    R_SPARC_HIX22                          = 48   #! High 22 bit complemented
    R_SPARC_LOX10                          = 49   #! Truncated 11 bit complemented
    R_SPARC_H44                            = 50   #! Direct high 12 of 44 bit
    R_SPARC_M44                            = 51   #! Direct mid 22 of 44 bit
    R_SPARC_L44                            = 52   #! Direct low 10 of 44 bit
    R_SPARC_REGISTER                       = 53   #! Global register usage
    R_SPARC_UA64                           = 54   #! Direct 64 bit unaligned
    R_SPARC_UA16                           = 55   #! Direct 16 bit unaligned
    R_SPARC_TLS_GD_HI22                    = 56
    R_SPARC_TLS_GD_LO10                    = 57
    R_SPARC_TLS_GD_ADD                     = 58
    R_SPARC_TLS_GD_CALL                    = 59
    R_SPARC_TLS_LDM_HI22                   = 60
    R_SPARC_TLS_LDM_LO10                   = 61
    R_SPARC_TLS_LDM_ADD                    = 62
    R_SPARC_TLS_LDM_CALL                   = 63
    R_SPARC_TLS_LDO_HIX22                  = 64
    R_SPARC_TLS_LDO_LOX10                  = 65
    R_SPARC_TLS_LDO_ADD                    = 66
    R_SPARC_TLS_IE_HI22                    = 67
    R_SPARC_TLS_IE_LO10                    = 68
    R_SPARC_TLS_IE_LD                      = 69
    R_SPARC_TLS_IE_LDX                     = 70
    R_SPARC_TLS_IE_ADD                     = 71
    R_SPARC_TLS_LE_HIX22                   = 72
    R_SPARC_TLS_LE_LOX10                   = 73
    R_SPARC_TLS_DTPMOD32                   = 74
    R_SPARC_TLS_DTPMOD64                   = 75
    R_SPARC_TLS_DTPOFF32                   = 76
    R_SPARC_TLS_DTPOFF64                   = 77
    R_SPARC_TLS_TPOFF32                    = 78
    R_SPARC_TLS_TPOFF64                    = 79
    R_SPARC_GOTDATA_HIX22                  = 80
    R_SPARC_GOTDATA_LOX10                  = 81
    R_SPARC_GOTDATA_OP_HIX22               = 82
    R_SPARC_GOTDATA_OP_LOX10               = 83
    R_SPARC_GOTDATA_OP                     = 84
    R_SPARC_H34                            = 85
    R_SPARC_SIZE32                         = 86
    R_SPARC_SIZE64                         = 87
    R_SPARC_WDISP10                        = 88
    R_SPARC_JMP_IREL                       = 248
    R_SPARC_IRELATIVE                      = 249
    R_SPARC_GNU_VTINHERIT                  = 250
    R_SPARC_GNU_VTENTRY                    = 251
    R_SPARC_REV32                          = 252
    R_SPARC_NUM                            = 253


class RelocsMips(enum.IntEnum):

    R_MIPS_NONE                            = 0    #! No reloc
    R_MIPS_16                              = 1    #! Direct 16 bit
    R_MIPS_32                              = 2    #! Direct 32 bit
    R_MIPS_REL32                           = 3    #! PC relative 32 bit
    R_MIPS_26                              = 4    #! Direct 26 bit shifted
    R_MIPS_HI16                            = 5    #! High 16 bit
    R_MIPS_LO16                            = 6    #! Low 16 bit
    R_MIPS_GPREL16                         = 7    #! GP relative 16 bit
    R_MIPS_LITERAL                         = 8    #! 16 bit literal entry
    R_MIPS_GOT16                           = 9    #! 16 bit GOT entry
    R_MIPS_PC16                            = 10   #! PC relative 16 bit
    R_MIPS_CALL16                          = 11   #! 16 bit GOT entry for function
    R_MIPS_GPREL32                         = 12   #! GP relative 32 bit
    R_MIPS_SHIFT5                          = 16
    R_MIPS_SHIFT6                          = 17
    R_MIPS_64                              = 18
    R_MIPS_GOT_DISP                        = 19
    R_MIPS_GOT_PAGE                        = 20
    R_MIPS_GOT_OFST                        = 21
    R_MIPS_GOT_HI16                        = 22
    R_MIPS_GOT_LO16                        = 23
    R_MIPS_SUB                             = 24
    R_MIPS_INSERT_A                        = 25
    R_MIPS_INSERT_B                        = 26
    R_MIPS_DELETE                          = 27
    R_MIPS_HIGHER                          = 28
    R_MIPS_HIGHEST                         = 29
    R_MIPS_CALL_HI16                       = 30
    R_MIPS_CALL_LO16                       = 31
    R_MIPS_SCN_DISP                        = 32
    R_MIPS_REL16                           = 33
    R_MIPS_ADD_IMMEDIATE                   = 34
    R_MIPS_PJUMP                           = 35
    R_MIPS_RELGOT                          = 36
    R_MIPS_JALR                            = 37
    R_MIPS_TLS_DTPMOD32                    = 38   #! Module number 32 bit
    R_MIPS_TLS_DTPREL32                    = 39   #! Module-relative offset 32 bit
    R_MIPS_TLS_DTPMOD64                    = 40   #! Module number 64 bit
    R_MIPS_TLS_DTPREL64                    = 41   #! Module-relative offset 64 bit
    R_MIPS_TLS_GD                          = 42   #! 16 bit GOT offset for GD
    R_MIPS_TLS_LDM                         = 43   #! 16 bit GOT offset for LDM
    R_MIPS_TLS_DTPREL_HI16                 = 44   #! Module-relative offset, high 16 bits
    R_MIPS_TLS_DTPREL_LO16                 = 45   #! Module-relative offset, low 16 bits
    R_MIPS_TLS_GOTTPREL                    = 46   #! 16 bit GOT offset for IE
    R_MIPS_TLS_TPREL32                     = 47   #! TP-relative offset, 32 bit
    R_MIPS_TLS_TPREL64                     = 48   #! TP-relative offset, 64 bit
    R_MIPS_TLS_TPREL_HI16                  = 49   #! TP-relative offset, high 16 bits
    R_MIPS_TLS_TPREL_LO16                  = 50   #! TP-relative offset, low 16 bits
    R_MIPS_GLOB_DAT                        = 51
    R_MIPS_COPY                            = 126
    R_MIPS_JUMP_SLOT                       = 127
    R_MIPS_NUM                             = 128


class RelocsParisc(enum.IntEnum):

    R_PARISC_NONE                          = 0    #! No reloc.
    R_PARISC_DIR32                         = 1    #! Direct 32-bit reference.
    R_PARISC_DIR21L                        = 2    #! Left 21 bits of eff. address.
    R_PARISC_DIR17R                        = 3    #! Right 17 bits of eff. address.
    R_PARISC_DIR17F                        = 4    #! 17 bits of eff. address.
    R_PARISC_DIR14R                        = 6    #! Right 14 bits of eff. address.
    R_PARISC_PCREL32                       = 9    #! 32-bit rel. address.
    R_PARISC_PCREL21L                      = 10   #! Left 21 bits of rel. address.
    R_PARISC_PCREL17R                      = 11   #! Right 17 bits of rel. address.
    R_PARISC_PCREL17F                      = 12   #! 17 bits of rel. address.
    R_PARISC_PCREL14R                      = 14   #! Right 14 bits of rel. address.
    R_PARISC_DPREL21L                      = 18   #! Left 21 bits of rel. address.
    R_PARISC_DPREL14R                      = 22   #! Right 14 bits of rel. address.
    R_PARISC_GPREL21L                      = 26   #! GP-relative, left 21 bits.
    R_PARISC_GPREL14R                      = 30   #! GP-relative, right 14 bits.
    R_PARISC_LTOFF21L                      = 34   #! LT-relative, left 21 bits.
    R_PARISC_LTOFF14R                      = 38   #! LT-relative, right 14 bits.
    R_PARISC_SECREL32                      = 41   #! 32 bits section rel. address.
    R_PARISC_SEGBASE                       = 48   #! No relocation, set segment base.
    R_PARISC_SEGREL32                      = 49   #! 32 bits segment rel. address.
    R_PARISC_PLTOFF21L                     = 50   #! PLT rel. address, left 21 bits.
    R_PARISC_PLTOFF14R                     = 54   #! PLT rel. address, right 14 bits.
    R_PARISC_LTOFF_FPTR32                  = 57   #! 32 bits LT-rel. function pointer.
    R_PARISC_LTOFF_FPTR21L                 = 58   #! LT-rel. fct ptr, left 21 bits.
    R_PARISC_LTOFF_FPTR14R                 = 62   #! LT-rel. fct ptr, right 14 bits.
    R_PARISC_FPTR64                        = 64   #! 64 bits function address.
    R_PARISC_PLABEL32                      = 65   #! 32 bits function address.
    R_PARISC_PLABEL21L                     = 66   #! Left 21 bits of fdesc address.
    R_PARISC_PLABEL14R                     = 70   #! Right 14 bits of fdesc address.
    R_PARISC_PCREL64                       = 72   #! 64 bits PC-rel. address.
    R_PARISC_PCREL22F                      = 74   #! 22 bits PC-rel. address.
    R_PARISC_PCREL14WR                     = 75   #! PC-rel. address, right 14 bits.
    R_PARISC_PCREL14DR                     = 76   #! PC rel. address, right 14 bits.
    R_PARISC_PCREL16F                      = 77   #! 16 bits PC-rel. address.
    R_PARISC_PCREL16WF                     = 78   #! 16 bits PC-rel. address.
    R_PARISC_PCREL16DF                     = 79   #! 16 bits PC-rel. address.
    R_PARISC_DIR64                         = 80   #! 64 bits of eff. address.
    R_PARISC_DIR14WR                       = 83   #! 14 bits of eff. address.
    R_PARISC_DIR14DR                       = 84   #! 14 bits of eff. address.
    R_PARISC_DIR16F                        = 85   #! 16 bits of eff. address.
    R_PARISC_DIR16WF                       = 86   #! 16 bits of eff. address.
    R_PARISC_DIR16DF                       = 87   #! 16 bits of eff. address.
    R_PARISC_GPREL64                       = 88   #! 64 bits of GP-rel. address.
    R_PARISC_GPREL14WR                     = 91   #! GP-rel. address, right 14 bits.
    R_PARISC_GPREL14DR                     = 92   #! GP-rel. address, right 14 bits.
    R_PARISC_GPREL16F                      = 93   #! 16 bits GP-rel. address.
    R_PARISC_GPREL16WF                     = 94   #! 16 bits GP-rel. address.
    R_PARISC_GPREL16DF                     = 95   #! 16 bits GP-rel. address.
    R_PARISC_LTOFF64                       = 96   #! 64 bits LT-rel. address.
    R_PARISC_LTOFF14WR                     = 99   #! LT-rel. address, right 14 bits.
    R_PARISC_LTOFF14DR                     = 100  #! LT-rel. address, right 14 bits.
    R_PARISC_LTOFF16F                      = 101  #! 16 bits LT-rel. address.
    R_PARISC_LTOFF16WF                     = 102  #! 16 bits LT-rel. address.
    R_PARISC_LTOFF16DF                     = 103  #! 16 bits LT-rel. address.
    R_PARISC_SECREL64                      = 104  #! 64 bits section rel. address.
    R_PARISC_SEGREL64                      = 112  #! 64 bits segment rel. address.
    R_PARISC_PLTOFF14WR                    = 115  #! PLT-rel. address, right 14 bits.
    R_PARISC_PLTOFF14DR                    = 116  #! PLT-rel. address, right 14 bits.
    R_PARISC_PLTOFF16F                     = 117  #! 16 bits LT-rel. address.
    R_PARISC_PLTOFF16WF                    = 118  #! 16 bits PLT-rel. address.
    R_PARISC_PLTOFF16DF                    = 119  #! 16 bits PLT-rel. address.
    R_PARISC_LTOFF_FPTR64                  = 120  #! 64 bits LT-rel. function ptr.
    R_PARISC_LTOFF_FPTR14WR                = 123  #! LT-rel. fct. ptr., right 14 bits.
    R_PARISC_LTOFF_FPTR14DR                = 124  #! LT-rel. fct. ptr., right 14 bits.
    R_PARISC_LTOFF_FPTR16F                 = 125  #! 16 bits LT-rel. function ptr.
    R_PARISC_LTOFF_FPTR16WF                = 126  #! 16 bits LT-rel. function ptr.
    R_PARISC_LTOFF_FPTR16DF                = 127  #! 16 bits LT-rel. function ptr.
    R_PARISC_LORESERVE                     = 128
    R_PARISC_COPY                          = 128  #! Copy relocation.
    R_PARISC_IPLT                          = 129  #! Dynamic reloc, imported PLT
    R_PARISC_EPLT                          = 130  #! Dynamic reloc, exported PLT
    R_PARISC_TPREL32                       = 153  #! 32 bits TP-rel. address.
    R_PARISC_TPREL21L                      = 154  #! TP-rel. address, left 21 bits.
    R_PARISC_TPREL14R                      = 158  #! TP-rel. address, right 14 bits.
    R_PARISC_LTOFF_TP21L                   = 162  #! LT-TP-rel. address, left 21 bits.
    R_PARISC_LTOFF_TP14R                   = 166  #! LT-TP-rel. address, right 14 bits.
    R_PARISC_LTOFF_TP14F                   = 167  #! 14 bits LT-TP-rel. address.
    R_PARISC_TPREL64                       = 216  #! 64 bits TP-rel. address.
    R_PARISC_TPREL14WR                     = 219  #! TP-rel. address, right 14 bits.
    R_PARISC_TPREL14DR                     = 220  #! TP-rel. address, right 14 bits.
    R_PARISC_TPREL16F                      = 221  #! 16 bits TP-rel. address.
    R_PARISC_TPREL16WF                     = 222  #! 16 bits TP-rel. address.
    R_PARISC_TPREL16DF                     = 223  #! 16 bits TP-rel. address.
    R_PARISC_LTOFF_TP64                    = 224  #! 64 bits LT-TP-rel. address.
    R_PARISC_LTOFF_TP14WR                  = 227  #! LT-TP-rel. address, right 14 bits.
    R_PARISC_LTOFF_TP14DR                  = 228  #! LT-TP-rel. address, right 14 bits.
    R_PARISC_LTOFF_TP16F                   = 229  #! 16 bits LT-TP-rel. address.
    R_PARISC_LTOFF_TP16WF                  = 230  #! 16 bits LT-TP-rel. address.
    R_PARISC_LTOFF_TP16DF                  = 231  #! 16 bits LT-TP-rel. address.
    R_PARISC_GNU_VTENTRY                   = 232
    R_PARISC_GNU_VTINHERIT                 = 233
    R_PARISC_TLS_GD21L                     = 234  #! GD 21-bit left.
    R_PARISC_TLS_GD14R                     = 235  #! GD 14-bit right.
    R_PARISC_TLS_GDCALL                    = 236  #! GD call to __t_g_a.
    R_PARISC_TLS_LDM21L                    = 237  #! LD module 21-bit left.
    R_PARISC_TLS_LDM14R                    = 238  #! LD module 14-bit right.
    R_PARISC_TLS_LDMCALL                   = 239  #! LD module call to __t_g_a.
    R_PARISC_TLS_LDO21L                    = 240  #! LD offset 21-bit left.
    R_PARISC_TLS_LDO14R                    = 241  #! LD offset 14-bit right.
    R_PARISC_TLS_DTPMOD32                  = 242  #! DTP module 32-bit.
    R_PARISC_TLS_DTPMOD64                  = 243  #! DTP module 64-bit.
    R_PARISC_TLS_DTPOFF32                  = 244  #! DTP offset 32-bit.
    R_PARISC_TLS_DTPOFF64                  = 245  #! DTP offset 32-bit.
    R_PARISC_HIRESERVE                     = 255


class RelocsAlpha(enum.IntEnum):

    R_ALPHA_NONE                           = 0    #! No reloc
    R_ALPHA_REFLONG                        = 1    #! Direct 32 bit
    R_ALPHA_REFQUAD                        = 2    #! Direct 64 bit
    R_ALPHA_GPREL32                        = 3    #! GP relative 32 bit
    R_ALPHA_LITERAL                        = 4    #! GP relative 16 bit w/optimization
    R_ALPHA_LITUSE                         = 5    #! Optimization hint for LITERAL
    R_ALPHA_GPDISP                         = 6    #! Add displacement to GP
    R_ALPHA_BRADDR                         = 7    #! PC+4 relative 23 bit shifted
    R_ALPHA_HINT                           = 8    #! PC+4 relative 16 bit shifted
    R_ALPHA_SREL16                         = 9    #! PC relative 16 bit
    R_ALPHA_SREL32                         = 10   #! PC relative 32 bit
    R_ALPHA_SREL64                         = 11   #! PC relative 64 bit
    R_ALPHA_GPRELHIGH                      = 17   #! GP relative 32 bit, high 16 bits
    R_ALPHA_GPRELLOW                       = 18   #! GP relative 32 bit, low 16 bits
    R_ALPHA_GPREL16                        = 19   #! GP relative 16 bit
    R_ALPHA_COPY                           = 24   #! Copy symbol at runtime
    R_ALPHA_GLOB_DAT                       = 25   #! Create GOT entry
    R_ALPHA_JMP_SLOT                       = 26   #! Create PLT entry
    R_ALPHA_RELATIVE                       = 27   #! Adjust by program base
    R_ALPHA_TLS_GD_HI                      = 28
    R_ALPHA_TLSGD                          = 29
    R_ALPHA_TLS_LDM                        = 30
    R_ALPHA_DTPMOD64                       = 31
    R_ALPHA_GOTDTPREL                      = 32
    R_ALPHA_DTPREL64                       = 33
    R_ALPHA_DTPRELHI                       = 34
    R_ALPHA_DTPRELLO                       = 35
    R_ALPHA_DTPREL16                       = 36
    R_ALPHA_GOTTPREL                       = 37
    R_ALPHA_TPREL64                        = 38
    R_ALPHA_TPRELHI                        = 39
    R_ALPHA_TPRELLO                        = 40
    R_ALPHA_TPREL16                        = 41
    R_ALPHA_NUM                            = 46


class RelocsPpc(enum.IntEnum):

    R_PPC_NONE                             = 0
    R_PPC_ADDR32                           = 1    #! 32bit absolute address
    R_PPC_ADDR24                           = 2    #! 26bit address, 2 bits ignored.
    R_PPC_ADDR16                           = 3    #! 16bit absolute address
    R_PPC_ADDR16_LO                        = 4    #! lower 16bit of absolute address
    R_PPC_ADDR16_HI                        = 5    #! high 16bit of absolute address
    R_PPC_ADDR16_HA                        = 6    #! adjusted high 16bit
    R_PPC_ADDR14                           = 7    #! 16bit address, 2 bits ignored
    R_PPC_ADDR14_BRTAKEN                   = 8
    R_PPC_ADDR14_BRNTAKEN                  = 9
    R_PPC_REL24                            = 10   #! PC relative 26 bit
    R_PPC_REL14                            = 11   #! PC relative 16 bit
    R_PPC_REL14_BRTAKEN                    = 12
    R_PPC_REL14_BRNTAKEN                   = 13
    R_PPC_GOT16                            = 14
    R_PPC_GOT16_LO                         = 15
    R_PPC_GOT16_HI                         = 16
    R_PPC_GOT16_HA                         = 17
    R_PPC_PLTREL24                         = 18
    R_PPC_COPY                             = 19
    R_PPC_GLOB_DAT                         = 20
    R_PPC_JMP_SLOT                         = 21
    R_PPC_RELATIVE                         = 22
    R_PPC_LOCAL24PC                        = 23
    R_PPC_UADDR32                          = 24
    R_PPC_UADDR16                          = 25
    R_PPC_REL32                            = 26
    R_PPC_PLT32                            = 27
    R_PPC_PLTREL32                         = 28
    R_PPC_PLT16_LO                         = 29
    R_PPC_PLT16_HI                         = 30
    R_PPC_PLT16_HA                         = 31
    R_PPC_SDAREL16                         = 32
    R_PPC_SECTOFF                          = 33
    R_PPC_SECTOFF_LO                       = 34
    R_PPC_SECTOFF_HI                       = 35
    R_PPC_SECTOFF_HA                       = 36
    R_PPC_TLS                              = 67   #! none (sym+add)@tls
    R_PPC_DTPMOD32                         = 68   #! word32 (sym+add)@dtpmod
    R_PPC_TPREL16_LO                       = 70   #! half16 (sym+add)@tprel@l
    R_PPC_TPREL16_HI                       = 71   #! half16 (sym+add)@tprel@h
    R_PPC_TPREL16_HA                       = 72   #! half16 (sym+add)@tprel@ha
    R_PPC_TPREL32                          = 73   #! word32 (sym+add)@tprel
    R_PPC_DTPREL16_LO                      = 75   #! half16 (sym+add)@dtprel@l
    R_PPC_DTPREL16_HI                      = 76   #! half16 (sym+add)@dtprel@h
    R_PPC_DTPREL16_HA                      = 77   #! half16 (sym+add)@dtprel@ha
    R_PPC_DTPREL32                         = 78   #! word32 (sym+add)@dtprel
    R_PPC_GOT_TLSGD16_LO                   = 80   #! half16 (sym+add)@got@tlsgd@l
    R_PPC_GOT_TLSGD16_HI                   = 81   #! half16 (sym+add)@got@tlsgd@h
    R_PPC_GOT_TLSGD16_HA                   = 82   #! half16 (sym+add)@got@tlsgd@ha
    R_PPC_GOT_TLSLD16_LO                   = 84   #! half16 (sym+add)@got@tlsld@l
    R_PPC_GOT_TLSLD16_HI                   = 85   #! half16 (sym+add)@got@tlsld@h
    R_PPC_GOT_TLSLD16_HA                   = 86   #! half16 (sym+add)@got@tlsld@ha
    R_PPC_GOT_TPREL16_LO                   = 88   #! half16 (sym+add)@got@tprel@l
    R_PPC_GOT_TPREL16_HI                   = 89   #! half16 (sym+add)@got@tprel@h
    R_PPC_GOT_TPREL16_HA                   = 90   #! half16 (sym+add)@got@tprel@ha
    R_PPC_TLSGD                            = 95   #! none (sym+add)@tlsgd
    R_PPC_TLSLD                            = 96   #! none (sym+add)@tlsld
    R_PPC_EMB_NADDR32                      = 101
    R_PPC_EMB_NADDR16                      = 102
    R_PPC_EMB_NADDR16_LO                   = 103
    R_PPC_EMB_NADDR16_HI                   = 104
    R_PPC_EMB_NADDR16_HA                   = 105
    R_PPC_EMB_SDAI16                       = 106
    R_PPC_EMB_SDA2I16                      = 107
    R_PPC_EMB_SDA2REL                      = 108
    R_PPC_EMB_SDA21                        = 109  #! 16 bit offset in SDA
    R_PPC_EMB_MRKREF                       = 110
    R_PPC_EMB_RELSEC16                     = 111
    R_PPC_EMB_RELST_LO                     = 112
    R_PPC_EMB_RELST_HI                     = 113
    R_PPC_EMB_RELST_HA                     = 114
    R_PPC_EMB_BIT_FLD                      = 115
    R_PPC_EMB_RELSDA                       = 116  #! 16 bit relative offset in SDA
    R_PPC_DIAB_SDA21_LO                    = 180  #! like EMB_SDA21, but lower 16 bit
    R_PPC_DIAB_SDA21_HI                    = 181  #! like EMB_SDA21, but high 16 bit
    R_PPC_DIAB_SDA21_HA                    = 182  #! like EMB_SDA21, adjusted high 16
    R_PPC_DIAB_RELSDA_LO                   = 183  #! like EMB_RELSDA, but lower 16 bit
    R_PPC_DIAB_RELSDA_HI                   = 184  #! like EMB_RELSDA, but high 16 bit
    R_PPC_DIAB_RELSDA_HA                   = 185  #! like EMB_RELSDA, adjusted high 16
    R_PPC_IRELATIVE                        = 248
    R_PPC_REL16                            = 249  #! half16 (sym+add-.)
    R_PPC_REL16_LO                         = 250  #! half16 (sym+add-.)@l
    R_PPC_REL16_HI                         = 251  #! half16 (sym+add-.)@h
    R_PPC_REL16_HA                         = 252  #! half16 (sym+add-.)@ha
    R_PPC_TOC16                            = 255


class RelocsPpc64(enum.IntEnum):

    R_PPC64_ADDR30                         = 37   #! word30 (S + A - P) >> 2
    R_PPC64_ADDR64                         = 38   #! doubleword64 S + A
    R_PPC64_ADDR16_HIGHER                  = 39   #! half16 #higher(S + A)
    R_PPC64_ADDR16_HIGHERA                 = 40   #! half16 #highera(S + A)
    R_PPC64_ADDR16_HIGHEST                 = 41   #! half16 #highest(S + A)
    R_PPC64_ADDR16_HIGHESTA                = 42   #! half16 #highesta(S + A)
    R_PPC64_UADDR64                        = 43   #! doubleword64 S + A
    R_PPC64_REL64                          = 44   #! doubleword64 S + A - P
    R_PPC64_PLT64                          = 45   #! doubleword64 L + A
    R_PPC64_PLTREL64                       = 46   #! doubleword64 L + A - P
    R_PPC64_TOC16_LO                       = 48   #! half16 #lo(S + A - .TOC.)
    R_PPC64_TOC16_HI                       = 49   #! half16 #hi(S + A - .TOC.)
    R_PPC64_TOC16_HA                       = 50   #! half16 #ha(S + A - .TOC.)
    R_PPC64_TOC                            = 51   #! doubleword64 .TOC
    R_PPC64_PLTGOT16_LO                    = 53   #! half16 #lo(M + A)
    R_PPC64_PLTGOT16_HI                    = 54   #! half16 #hi(M + A)
    R_PPC64_PLTGOT16_HA                    = 55   #! half16 #ha(M + A)
    R_PPC64_ADDR16_LO_DS                   = 57   #! half16ds #lo(S + A) >> 2
    R_PPC64_GOT16_LO_DS                    = 59   #! half16ds #lo(G + A) >> 2
    R_PPC64_PLT16_LO_DS                    = 60   #! half16ds #lo(L + A) >> 2
    R_PPC64_SECTOFF_LO_DS                  = 62   #! half16ds #lo(R + A) >> 2
    R_PPC64_TOC16_LO_DS                    = 64   #! half16ds #lo(S + A - .TOC.) >> 2
    R_PPC64_PLTGOT16_LO_DS                 = 66   #! half16ds #lo(M + A) >> 2
    R_PPC64_TLS                            = 67   #! none (sym+add)@tls
    R_PPC64_DTPMOD64                       = 68   #! doubleword64 (sym+add)@dtpmod
    R_PPC64_TPREL16_LO                     = 70   #! half16 (sym+add)@tprel@l
    R_PPC64_TPREL16_HI                     = 71   #! half16 (sym+add)@tprel@h
    R_PPC64_TPREL16_HA                     = 72   #! half16 (sym+add)@tprel@ha
    R_PPC64_TPREL64                        = 73   #! doubleword64 (sym+add)@tprel
    R_PPC64_DTPREL16_LO                    = 75   #! half16 (sym+add)@dtprel@l
    R_PPC64_DTPREL16_HI                    = 76   #! half16 (sym+add)@dtprel@h
    R_PPC64_DTPREL16_HA                    = 77   #! half16 (sym+add)@dtprel@ha
    R_PPC64_DTPREL64                       = 78   #! doubleword64 (sym+add)@dtprel
    R_PPC64_GOT_TLSGD16_LO                 = 80   #! half16 (sym+add)@got@tlsgd@l
    R_PPC64_GOT_TLSGD16_HI                 = 81   #! half16 (sym+add)@got@tlsgd@h
    R_PPC64_GOT_TLSGD16_HA                 = 82   #! half16 (sym+add)@got@tlsgd@ha
    R_PPC64_GOT_TLSLD16_LO                 = 84   #! half16 (sym+add)@got@tlsld@l
    R_PPC64_GOT_TLSLD16_HI                 = 85   #! half16 (sym+add)@got@tlsld@h
    R_PPC64_GOT_TLSLD16_HA                 = 86   #! half16 (sym+add)@got@tlsld@ha
    R_PPC64_GOT_TPREL16_LO_DS              = 88   #! half16ds (sym+add)@got@tprel@l
    R_PPC64_GOT_TPREL16_HI                 = 89   #! half16 (sym+add)@got@tprel@h
    R_PPC64_GOT_TPREL16_HA                 = 90   #! half16 (sym+add)@got@tprel@ha
    R_PPC64_GOT_DTPREL16_LO_DS             = 92   #! half16ds (sym+add)@got@dtprel@l
    R_PPC64_GOT_DTPREL16_HI                = 93   #! half16 (sym+add)@got@dtprel@h
    R_PPC64_GOT_DTPREL16_HA                = 94   #! half16 (sym+add)@got@dtprel@ha
    R_PPC64_TPREL16_LO_DS                  = 96   #! half16ds (sym+add)@tprel@l
    R_PPC64_TPREL16_HIGHER                 = 97   #! half16 (sym+add)@tprel@higher
    R_PPC64_TPREL16_HIGHERA                = 98   #! half16 (sym+add)@tprel@highera
    R_PPC64_TPREL16_HIGHEST                = 99   #! half16 (sym+add)@tprel@highest
    R_PPC64_TPREL16_HIGHESTA               = 100  #! half16 (sym+add)@tprel@highesta
    R_PPC64_DTPREL16_LO_DS                 = 102  #! half16ds (sym+add)@dtprel@l
    R_PPC64_DTPREL16_HIGHER                = 103  #! half16 (sym+add)@dtprel@higher
    R_PPC64_DTPREL16_HIGHERA               = 104  #! half16 (sym+add)@dtprel@highera
    R_PPC64_DTPREL16_HIGHEST               = 105  #! half16 (sym+add)@dtprel@highest
    R_PPC64_DTPREL16_HIGHESTA              = 106  #! half16 (sym+add)@dtprel@highesta
    R_PPC64_TLSGD                          = 107  #! none (sym+add)@tlsgd
    R_PPC64_TLSLD                          = 108  #! none (sym+add)@tlsld
    R_PPC64_TOCSAVE                        = 109  #! none
    R_PPC64_ADDR16_HIGH                    = 110
    R_PPC64_ADDR16_HIGHA                   = 111
    R_PPC64_TPREL16_HIGH                   = 112
    R_PPC64_TPREL16_HIGHA                  = 113
    R_PPC64_DTPREL16_HIGH                  = 114
    R_PPC64_DTPREL16_HIGHA                 = 115
    R_PPC64_JMP_IREL                       = 247
    R_PPC64_IRELATIVE                      = 248
    R_PPC64_REL16                          = 249  #! half16 (sym+add-.)
    R_PPC64_REL16_LO                       = 250  #! half16 (sym+add-.)@l
    R_PPC64_REL16_HI                       = 251  #! half16 (sym+add-.)@h
    R_PPC64_REL16_HA                       = 252  #! half16 (sym+add-.)@ha


class RelocsAarch64(enum.IntEnum):

    R_AARCH64_NONE                         = 0    #! No relocation.
    R_AARCH64_P32_ABS32                    = 1    #! Direct 32 bit.
    R_AARCH64_P32_COPY                     = 180  #! Copy symbol at runtime.
    R_AARCH64_P32_GLOB_DAT                 = 181  #! Create GOT entry.
    R_AARCH64_P32_JUMP_SLOT                = 182  #! Create PLT entry.
    R_AARCH64_P32_RELATIVE                 = 183  #! Adjust by program base.
    R_AARCH64_P32_TLS_DTPMOD               = 184  #! Module number, 32 bit.
    R_AARCH64_P32_TLS_DTPREL               = 185  #! Module-relative offset, 32 bit.
    R_AARCH64_P32_TLS_TPREL                = 186  #! TP-relative offset, 32 bit.
    R_AARCH64_P32_TLSDESC                  = 187  #! TLS Descriptor.
    R_AARCH64_P32_IRELATIVE                = 188  #! STT_GNU_IFUNC relocation.
    R_AARCH64_ABS64                        = 257  #! Direct 64 bit.
    R_AARCH64_ABS32                        = 258  #! Direct 32 bit.
    R_AARCH64_ABS16                        = 259  #! Direct 16-bit.
    R_AARCH64_PREL64                       = 260  #! PC-relative 64-bit.
    R_AARCH64_PREL32                       = 261  #! PC-relative 32-bit.
    R_AARCH64_PREL16                       = 262  #! PC-relative 16-bit.
    R_AARCH64_MOVW_UABS_G0                 = 263  #! Dir. MOVZ imm. from bits 15:0.
    R_AARCH64_MOVW_UABS_G0_NC              = 264  #! Likewise for MOVK; no check.
    R_AARCH64_MOVW_UABS_G1                 = 265  #! Dir. MOVZ imm. from bits 31:16.
    R_AARCH64_MOVW_UABS_G1_NC              = 266  #! Likewise for MOVK; no check.
    R_AARCH64_MOVW_UABS_G2                 = 267  #! Dir. MOVZ imm. from bits 47:32.
    R_AARCH64_MOVW_UABS_G2_NC              = 268  #! Likewise for MOVK; no check.
    R_AARCH64_MOVW_UABS_G3                 = 269  #! Dir. MOV{K,Z} imm. from 63:48.
    R_AARCH64_MOVW_SABS_G0                 = 270  #! Dir. MOV{N,Z} imm. from 15:0.
    R_AARCH64_MOVW_SABS_G1                 = 271  #! Dir. MOV{N,Z} imm. from 31:16.
    R_AARCH64_MOVW_SABS_G2                 = 272  #! Dir. MOV{N,Z} imm. from 47:32.
    R_AARCH64_LD_PREL_LO19                 = 273  #! PC-rel. LD imm. from bits 20:2.
    R_AARCH64_ADR_PREL_LO21                = 274  #! PC-rel. ADR imm. from bits 20:0.
    R_AARCH64_ADR_PREL_PG_HI21             = 275  #! Page-rel. ADRP imm. from 32:12.
    R_AARCH64_ADR_PREL_PG_HI21_NC          = 276  #! Likewise; no overflow check.
    R_AARCH64_ADD_ABS_LO12_NC              = 277  #! Dir. ADD imm. from bits 11:0.
    R_AARCH64_LDST8_ABS_LO12_NC            = 278  #! Likewise for LD/ST; no check.
    R_AARCH64_TSTBR14                      = 279  #! PC-rel. TBZ/TBNZ imm. from 15:2.
    R_AARCH64_CONDBR19                     = 280  #! PC-rel. cond. br. imm. from 20:2.
    R_AARCH64_JUMP26                       = 282  #! PC-rel. B imm. from bits 27:2.
    R_AARCH64_CALL26                       = 283  #! Likewise for CALL.
    R_AARCH64_LDST16_ABS_LO12_NC           = 284  #! Dir. ADD imm. from bits 11:1.
    R_AARCH64_LDST32_ABS_LO12_NC           = 285  #! Likewise for bits 11:2.
    R_AARCH64_LDST64_ABS_LO12_NC           = 286  #! Likewise for bits 11:3.
    R_AARCH64_MOVW_PREL_G0                 = 287  #! PC-rel. MOV{N,Z} imm. from 15:0.
    R_AARCH64_MOVW_PREL_G0_NC              = 288  #! Likewise for MOVK; no check.
    R_AARCH64_MOVW_PREL_G1                 = 289  #! PC-rel. MOV{N,Z} imm. from 31:16.
    R_AARCH64_MOVW_PREL_G1_NC              = 290  #! Likewise for MOVK; no check.
    R_AARCH64_MOVW_PREL_G2                 = 291  #! PC-rel. MOV{N,Z} imm. from 47:32.
    R_AARCH64_MOVW_PREL_G2_NC              = 292  #! Likewise for MOVK; no check.
    R_AARCH64_MOVW_PREL_G3                 = 293  #! PC-rel. MOV{N,Z} imm. from 63:48.
    R_AARCH64_LDST128_ABS_LO12_NC          = 299  #! Dir. ADD imm. from bits 11:4.
    R_AARCH64_MOVW_GOTOFF_G0               = 300  #! GOT-rel. off. MOV{N,Z} imm. 15:0.
    R_AARCH64_MOVW_GOTOFF_G0_NC            = 301  #! Likewise for MOVK; no check.
    R_AARCH64_MOVW_GOTOFF_G1               = 302  #! GOT-rel. o. MOV{N,Z} imm. 31:16.
    R_AARCH64_MOVW_GOTOFF_G1_NC            = 303  #! Likewise for MOVK; no check.
    R_AARCH64_MOVW_GOTOFF_G2               = 304  #! GOT-rel. o. MOV{N,Z} imm. 47:32.
    R_AARCH64_MOVW_GOTOFF_G2_NC            = 305  #! Likewise for MOVK; no check.
    R_AARCH64_MOVW_GOTOFF_G3               = 306  #! GOT-rel. o. MOV{N,Z} imm. 63:48.
    R_AARCH64_GOTREL64                     = 307  #! GOT-relative 64-bit.
    R_AARCH64_GOTREL32                     = 308  #! GOT-relative 32-bit.
    R_AARCH64_GOT_LD_PREL19                = 309  #! PC-rel. GOT off. load imm. 20:2.
    R_AARCH64_LD64_GOTOFF_LO15             = 310  #! GOT-rel. off. LD/ST imm. 14:3.
    R_AARCH64_ADR_GOT_PAGE                 = 311  #! P-page-rel. GOT off. ADRP 32:12.
    R_AARCH64_LD64_GOT_LO12_NC             = 312  #! Dir. GOT off. LD/ST imm. 11:3.
    R_AARCH64_LD64_GOTPAGE_LO15            = 313  #! GOT-page-rel. GOT off. LD/ST 14:3
    R_AARCH64_TLSGD_ADR_PREL21             = 512  #! PC-relative ADR imm. 20:0.
    R_AARCH64_TLSGD_ADR_PAGE21             = 513  #! page-rel. ADRP imm. 32:12.
    R_AARCH64_TLSGD_ADD_LO12_NC            = 514  #! direct ADD imm. from 11:0.
    R_AARCH64_TLSGD_MOVW_G1                = 515  #! GOT-rel. MOV{N,Z} 31:16.
    R_AARCH64_TLSGD_MOVW_G0_NC             = 516  #! GOT-rel. MOVK imm. 15:0.
    R_AARCH64_TLSLD_ADR_PREL21             = 517  #! Like 512; local dynamic model.
    R_AARCH64_TLSLD_ADR_PAGE21             = 518  #! Like 513; local dynamic model.
    R_AARCH64_TLSLD_ADD_LO12_NC            = 519  #! Like 514; local dynamic model.
    R_AARCH64_TLSLD_MOVW_G1                = 520  #! Like 515; local dynamic model.
    R_AARCH64_TLSLD_MOVW_G0_NC             = 521  #! Like 516; local dynamic model.
    R_AARCH64_TLSLD_LD_PREL19              = 522  #! TLS PC-rel. load imm. 20:2.
    R_AARCH64_TLSLD_MOVW_DTPREL_G2         = 523  #! TLS DTP-rel. MOV{N,Z} 47:32.
    R_AARCH64_TLSLD_MOVW_DTPREL_G1         = 524  #! TLS DTP-rel. MOV{N,Z} 31:16.
    R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC      = 525  #! Likewise; MOVK; no check.
    R_AARCH64_TLSLD_MOVW_DTPREL_G0         = 526  #! TLS DTP-rel. MOV{N,Z} 15:0.
    R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC      = 527  #! Likewise; MOVK; no check.
    R_AARCH64_TLSLD_ADD_DTPREL_HI12        = 528  #! DTP-rel. ADD imm. from 23:12.
    R_AARCH64_TLSLD_ADD_DTPREL_LO12        = 529  #! DTP-rel. ADD imm. from 11:0.
    R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC     = 530  #! Likewise; no ovfl. check.
    R_AARCH64_TLSLD_LDST8_DTPREL_LO12      = 531  #! DTP-rel. LD/ST imm. 11:0.
    R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC   = 532  #! Likewise; no check.
    R_AARCH64_TLSLD_LDST16_DTPREL_LO12     = 533  #! DTP-rel. LD/ST imm. 11:1.
    R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC  = 534  #! Likewise; no check.
    R_AARCH64_TLSLD_LDST32_DTPREL_LO12     = 535  #! DTP-rel. LD/ST imm. 11:2.
    R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC  = 536  #! Likewise; no check.
    R_AARCH64_TLSLD_LDST64_DTPREL_LO12     = 537  #! DTP-rel. LD/ST imm. 11:3.
    R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC  = 538  #! Likewise; no check.
    R_AARCH64_TLSIE_MOVW_GOTTPREL_G1       = 539  #! GOT-rel. MOV{N,Z} 31:16.
    R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC    = 540  #! GOT-rel. MOVK 15:0.
    R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21    = 541  #! Page-rel. ADRP 32:12.
    R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC  = 542  #! Direct LD off. 11:3.
    R_AARCH64_TLSIE_LD_GOTTPREL_PREL19     = 543  #! PC-rel. load imm. 20:2.
    R_AARCH64_TLSLE_MOVW_TPREL_G2          = 544  #! TLS TP-rel. MOV{N,Z} 47:32.
    R_AARCH64_TLSLE_MOVW_TPREL_G1          = 545  #! TLS TP-rel. MOV{N,Z} 31:16.
    R_AARCH64_TLSLE_MOVW_TPREL_G1_NC       = 546  #! Likewise; MOVK; no check.
    R_AARCH64_TLSLE_MOVW_TPREL_G0          = 547  #! TLS TP-rel. MOV{N,Z} 15:0.
    R_AARCH64_TLSLE_MOVW_TPREL_G0_NC       = 548  #! Likewise; MOVK; no check.
    R_AARCH64_TLSLE_ADD_TPREL_HI12         = 549  #! TP-rel. ADD imm. 23:12.
    R_AARCH64_TLSLE_ADD_TPREL_LO12         = 550  #! TP-rel. ADD imm. 11:0.
    R_AARCH64_TLSLE_ADD_TPREL_LO12_NC      = 551  #! Likewise; no ovfl. check.
    R_AARCH64_TLSLE_LDST8_TPREL_LO12       = 552  #! TP-rel. LD/ST off. 11:0.
    R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC    = 553  #! Likewise; no ovfl. check.
    R_AARCH64_TLSLE_LDST16_TPREL_LO12      = 554  #! TP-rel. LD/ST off. 11:1.
    R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC   = 555  #! Likewise; no check.
    R_AARCH64_TLSLE_LDST32_TPREL_LO12      = 556  #! TP-rel. LD/ST off. 11:2.
    R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC   = 557  #! Likewise; no check.
    R_AARCH64_TLSLE_LDST64_TPREL_LO12      = 558  #! TP-rel. LD/ST off. 11:3.
    R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC   = 559  #! Likewise; no check.
    R_AARCH64_TLSDESC_LD_PREL19            = 560  #! PC-rel. load immediate 20:2.
    R_AARCH64_TLSDESC_ADR_PREL21           = 561  #! PC-rel. ADR immediate 20:0.
    R_AARCH64_TLSDESC_ADR_PAGE21           = 562  #! Page-rel. ADRP imm. 32:12.
    R_AARCH64_TLSDESC_LD64_LO12            = 563  #! Direct LD off. from 11:3.
    R_AARCH64_TLSDESC_ADD_LO12             = 564  #! Direct ADD imm. from 11:0.
    R_AARCH64_TLSDESC_OFF_G1               = 565  #! GOT-rel. MOV{N,Z} imm. 31:16.
    R_AARCH64_TLSDESC_OFF_G0_NC            = 566  #! GOT-rel. MOVK imm. 15:0; no ck.
    R_AARCH64_TLSDESC_LDR                  = 567  #! Relax LDR.
    R_AARCH64_TLSDESC_ADD                  = 568  #! Relax ADD.
    R_AARCH64_TLSDESC_CALL                 = 569  #! Relax BLR.
    R_AARCH64_TLSLE_LDST128_TPREL_LO12     = 570  #! TP-rel. LD/ST off. 11:4.
    R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC  = 571  #! Likewise; no check.
    R_AARCH64_TLSLD_LDST128_DTPREL_LO12    = 572  #! DTP-rel. LD/ST imm. 11:4.
    R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC = 573  #! Likewise; no check.
    R_AARCH64_COPY                         = 1024 #! Copy symbol at runtime.
    R_AARCH64_GLOB_DAT                     = 1025 #! Create GOT entry.
    R_AARCH64_JUMP_SLOT                    = 1026 #! Create PLT entry.
    R_AARCH64_RELATIVE                     = 1027 #! Adjust by program base.
    R_AARCH64_TLS_DTPMOD                   = 1028 #! Module number, 64 bit.
    R_AARCH64_TLS_DTPREL                   = 1029 #! Module-relative offset, 64 bit.
    R_AARCH64_TLS_TPREL                    = 1030 #! TP-relative offset, 64 bit.
    R_AARCH64_TLSDESC                      = 1031 #! TLS Descriptor.
    R_AARCH64_IRELATIVE                    = 1032 #! STT_GNU_IFUNC relocation.


class RelocsArm(enum.IntEnum):

    R_ARM_NONE                             = 0    #! No reloc
    R_ARM_PC24                             = 1    #! Deprecated PC relative 26 bit branch.
    R_ARM_ABS32                            = 2    #! Direct 32 bit
    R_ARM_REL32                            = 3    #! PC relative 32 bit
    R_ARM_PC13                             = 4
    R_ARM_ABS16                            = 5    #! Direct 16 bit
    R_ARM_ABS12                            = 6    #! Direct 12 bit
    R_ARM_THM_ABS5                         = 7    #! Direct & 0x7C (LDR, STR).
    R_ARM_ABS8                             = 8    #! Direct 8 bit
    R_ARM_SBREL32                          = 9
    R_ARM_THM_PC22                         = 10   #! PC relative 24 bit (Thumb32 BL).
    R_ARM_THM_PC8                          = 11   #! PC relative & 0x3FC (Thumb16 LDR, ADD, ADR).
    R_ARM_AMP_VCALL9                       = 12
    R_ARM_SWI24                            = 13   #! Obsolete static relocation.
    R_ARM_TLS_DESC                         = 13   #! Dynamic relocation.
    R_ARM_THM_SWI8                         = 14   #! Reserved.
    R_ARM_XPC25                            = 15   #! Reserved.
    R_ARM_THM_XPC22                        = 16   #! Reserved.
    R_ARM_TLS_DTPMOD32                     = 17   #! ID of module containing symbol
    R_ARM_TLS_DTPOFF32                     = 18   #! Offset in TLS block
    R_ARM_TLS_TPOFF32                      = 19   #! Offset in static TLS block
    R_ARM_COPY                             = 20   #! Copy symbol at runtime
    R_ARM_GLOB_DAT                         = 21   #! Create GOT entry
    R_ARM_JUMP_SLOT                        = 22   #! Create PLT entry
    R_ARM_RELATIVE                         = 23   #! Adjust by program base
    R_ARM_GOTOFF                           = 24   #! 32 bit offset to GOT
    R_ARM_GOTPC                            = 25   #! 32 bit PC relative offset to GOT
    R_ARM_GOT32                            = 26   #! 32 bit GOT entry
    R_ARM_PLT32                            = 27   #! Deprecated, 32 bit PLT address.
    R_ARM_CALL                             = 28   #! PC relative 24 bit (BL, BLX).
    R_ARM_JUMP24                           = 29   #! PC relative 24 bit (B, BL<cond>).
    R_ARM_THM_JUMP24                       = 30   #! PC relative 24 bit (Thumb32 B.W).
    R_ARM_BASE_ABS                         = 31   #! Adjust by program base.
    R_ARM_ALU_PCREL_7_0                    = 32   #! Obsolete.
    R_ARM_ALU_PCREL_15_8                   = 33   #! Obsolete.
    R_ARM_ALU_PCREL_23_15                  = 34   #! Obsolete.
    R_ARM_LDR_SBREL_11_0                   = 35   #! Deprecated, prog. base relative.
    R_ARM_ALU_SBREL_19_12                  = 36   #! Deprecated, prog. base relative.
    R_ARM_ALU_SBREL_27_20                  = 37   #! Deprecated, prog. base relative.
    R_ARM_TARGET1                          = 38
    R_ARM_SBREL31                          = 39   #! Program base relative.
    R_ARM_V4BX                             = 40
    R_ARM_TARGET2                          = 41
    R_ARM_PREL31                           = 42   #! 32 bit PC relative.
    R_ARM_MOVW_ABS_NC                      = 43   #! Direct 16-bit (MOVW).
    R_ARM_MOVT_ABS                         = 44   #! Direct high 16-bit (MOVT).
    R_ARM_MOVW_PREL_NC                     = 45   #! PC relative 16-bit (MOVW).
    R_ARM_MOVT_PREL                        = 46   #! PC relative (MOVT).
    R_ARM_THM_MOVW_ABS_NC                  = 47   #! Direct 16 bit (Thumb32 MOVW).
    R_ARM_THM_MOVT_ABS                     = 48   #! Direct high 16 bit (Thumb32 MOVT).
    R_ARM_THM_MOVW_PREL_NC                 = 49   #! PC relative 16 bit (Thumb32 MOVW).
    R_ARM_THM_MOVT_PREL                    = 50   #! PC relative high 16 bit (Thumb32 MOVT).
    R_ARM_THM_JUMP19                       = 51   #! PC relative 20 bit (Thumb32 B<cond>.W).
    R_ARM_THM_JUMP6                        = 52   #! PC relative X & 0x7E (Thumb16 CBZ, CBNZ).
    R_ARM_THM_ALU_PREL_11_0                = 53   #! PC relative 12 bit (Thumb32 ADR.W).
    R_ARM_THM_PC12                         = 54   #! PC relative 12 bit (Thumb32 LDR{D,SB,H,SH}).
    R_ARM_ABS32_NOI                        = 55   #! Direct 32-bit.
    R_ARM_REL32_NOI                        = 56   #! PC relative 32-bit.
    R_ARM_ALU_PC_G0_NC                     = 57   #! PC relative (ADD, SUB).
    R_ARM_ALU_PC_G0                        = 58   #! PC relative (ADD, SUB).
    R_ARM_ALU_PC_G1_NC                     = 59   #! PC relative (ADD, SUB).
    R_ARM_ALU_PC_G1                        = 60   #! PC relative (ADD, SUB).
    R_ARM_ALU_PC_G2                        = 61   #! PC relative (ADD, SUB).
    R_ARM_LDR_PC_G1                        = 62   #! PC relative (LDR,STR,LDRB,STRB).
    R_ARM_LDR_PC_G2                        = 63   #! PC relative (LDR,STR,LDRB,STRB).
    R_ARM_LDRS_PC_G0                       = 64   #! PC relative (STR{D,H}, LDR{D,SB,H,SH}).
    R_ARM_LDRS_PC_G1                       = 65   #! PC relative (STR{D,H}, LDR{D,SB,H,SH}).
    R_ARM_LDRS_PC_G2                       = 66   #! PC relative (STR{D,H}, LDR{D,SB,H,SH}).
    R_ARM_LDC_PC_G0                        = 67   #! PC relative (LDC, STC).
    R_ARM_LDC_PC_G1                        = 68   #! PC relative (LDC, STC).
    R_ARM_LDC_PC_G2                        = 69   #! PC relative (LDC, STC).
    R_ARM_ALU_SB_G0_NC                     = 70   #! Program base relative (ADD,SUB).
    R_ARM_ALU_SB_G0                        = 71   #! Program base relative (ADD,SUB).
    R_ARM_ALU_SB_G1_NC                     = 72   #! Program base relative (ADD,SUB).
    R_ARM_ALU_SB_G1                        = 73   #! Program base relative (ADD,SUB).
    R_ARM_ALU_SB_G2                        = 74   #! Program base relative (ADD,SUB).
    R_ARM_LDR_SB_G0                        = 75   #! Program base relative (LDR, STR, LDRB, STRB).
    R_ARM_LDR_SB_G1                        = 76   #! Program base relative (LDR, STR, LDRB, STRB).
    R_ARM_LDR_SB_G2                        = 77   #! Program base relative (LDR, STR, LDRB, STRB).
    R_ARM_LDRS_SB_G0                       = 78   #! Program base relative (LDR, STR, LDRB, STRB).
    R_ARM_LDRS_SB_G1                       = 79   #! Program base relative (LDR, STR, LDRB, STRB).
    R_ARM_LDRS_SB_G2                       = 80   #! Program base relative (LDR, STR, LDRB, STRB).
    R_ARM_LDC_SB_G0                        = 81   #! Program base relative (LDC,STC).
    R_ARM_LDC_SB_G1                        = 82   #! Program base relative (LDC,STC).
    R_ARM_LDC_SB_G2                        = 83   #! Program base relative (LDC,STC).
    R_ARM_MOVW_BREL_NC                     = 84   #! Program base relative 16 bit (MOVW).
    R_ARM_MOVT_BREL                        = 85   #! Program base relative high 16 bit (MOVT).
    R_ARM_MOVW_BREL                        = 86   #! Program base relative 16 bit (MOVW).
    R_ARM_THM_MOVW_BREL_NC                 = 87   #! Program base relative 16 bit (Thumb32 MOVW).
    R_ARM_THM_MOVT_BREL                    = 88   #! Program base relative high 16 bit (Thumb32 MOVT).
    R_ARM_THM_MOVW_BREL                    = 89   #! Program base relative 16 bit (Thumb32 MOVW).
    R_ARM_TLS_GOTDESC                      = 90
    R_ARM_TLS_CALL                         = 91
    R_ARM_TLS_DESCSEQ                      = 92   #! TLS relaxation.
    R_ARM_THM_TLS_CALL                     = 93
    R_ARM_PLT32_ABS                        = 94
    R_ARM_GOT_ABS                          = 95   #! GOT entry.
    R_ARM_GOT_PREL                         = 96   #! PC relative GOT entry.
    R_ARM_GOT_BREL12                       = 97   #! GOT entry relative to GOT origin (LDR).
    R_ARM_GOTOFF12                         = 98   #! 12 bit, GOT entry relative to GOT origin (LDR, STR).
    R_ARM_GOTRELAX                         = 99
    R_ARM_GNU_VTENTRY                      = 100
    R_ARM_GNU_VTINHERIT                    = 101
    R_ARM_THM_PC11                         = 102  #! PC relative & 0xFFE (Thumb16 B).
    R_ARM_THM_PC9                          = 103  #! PC relative & 0x1FE (Thumb16 B/B<cond>).
    R_ARM_TLS_GD32                         = 104  #! PC-rel 32 bit for global dynamic thread local data
    R_ARM_TLS_LDM32                        = 105  #! PC-rel 32 bit for local dynamic thread local data
    R_ARM_TLS_LDO32                        = 106  #! 32 bit offset relative to TLS block
    R_ARM_TLS_IE32                         = 107  #! PC-rel 32 bit for GOT entry of static TLS block offset
    R_ARM_TLS_LE32                         = 108  #! 32 bit offset relative to static TLS block
    R_ARM_TLS_LDO12                        = 109  #! 12 bit relative to TLS block (LDR, STR).
    R_ARM_TLS_LE12                         = 110  #! 12 bit relative to static TLS block (LDR, STR).
    R_ARM_TLS_IE12GP                       = 111  #! 12 bit GOT entry relative to GOT origin (LDR).
    R_ARM_ME_TOO                           = 128  #! Obsolete.
    R_ARM_THM_TLS_DESCSEQ                  = 129
    R_ARM_THM_TLS_DESCSEQ16                = 129
    R_ARM_THM_TLS_DESCSEQ32                = 130
    R_ARM_THM_GOT_BREL12                   = 131  #! GOT entry relative to GOT origin, 12 bit (Thumb32 LDR).
    R_ARM_IRELATIVE                        = 160
    R_ARM_RXPC25                           = 249
    R_ARM_RSBREL32                         = 250
    R_ARM_THM_RPC22                        = 251
    R_ARM_RREL32                           = 252
    R_ARM_RABS22                           = 253
    R_ARM_RPC24                            = 254
    R_ARM_RBASE                            = 255
    R_ARM_NUM                              = 256


class RelocsSh(enum.IntEnum):

    R_SH_NONE                              = 0
    R_SH_DIR32                             = 1
    R_SH_REL32                             = 2
    R_SH_DIR8WPN                           = 3
    R_SH_IND12W                            = 4
    R_SH_DIR8WPL                           = 5
    R_SH_DIR8WPZ                           = 6
    R_SH_DIR8BP                            = 7
    R_SH_DIR8W                             = 8
    R_SH_DIR8L                             = 9
    R_SH_SWITCH16                          = 25
    R_SH_SWITCH32                          = 26
    R_SH_USES                              = 27
    R_SH_COUNT                             = 28
    R_SH_ALIGN                             = 29
    R_SH_CODE                              = 30
    R_SH_DATA                              = 31
    R_SH_LABEL                             = 32
    R_SH_SWITCH8                           = 33
    R_SH_GNU_VTINHERIT                     = 34
    R_SH_GNU_VTENTRY                       = 35
    R_SH_TLS_GD_32                         = 144
    R_SH_TLS_LD_32                         = 145
    R_SH_TLS_LDO_32                        = 146
    R_SH_TLS_IE_32                         = 147
    R_SH_TLS_LE_32                         = 148
    R_SH_TLS_DTPMOD32                      = 149
    R_SH_TLS_DTPOFF32                      = 150
    R_SH_TLS_TPOFF32                       = 151
    R_SH_GOT32                             = 160
    R_SH_PLT32                             = 161
    R_SH_COPY                              = 162
    R_SH_GLOB_DAT                          = 163
    R_SH_JMP_SLOT                          = 164
    R_SH_RELATIVE                          = 165
    R_SH_GOTOFF                            = 166
    R_SH_GOTPC                             = 167
    R_SH_NUM                               = 256


class Relocs390(enum.IntEnum):

    R_390_NONE                             = 0    #! No reloc.
    R_390_8                                = 1    #! Direct 8 bit.
    R_390_12                               = 2    #! Direct 12 bit.
    R_390_16                               = 3    #! Direct 16 bit.
    R_390_32                               = 4    #! Direct 32 bit.
    R_390_PC32                             = 5    #! PC relative 32 bit.
    R_390_GOT12                            = 6    #! 12 bit GOT offset.
    R_390_GOT32                            = 7    #! 32 bit GOT offset.
    R_390_PLT32                            = 8    #! 32 bit PC relative PLT address.
    R_390_COPY                             = 9    #! Copy symbol at runtime.
    R_390_GLOB_DAT                         = 10   #! Create GOT entry.
    R_390_JMP_SLOT                         = 11   #! Create PLT entry.
    R_390_RELATIVE                         = 12   #! Adjust by program base.
    R_390_GOTOFF32                         = 13   #! 32 bit offset to GOT.
    R_390_GOTPC                            = 14   #! 32 bit PC relative offset to GOT.
    R_390_GOT16                            = 15   #! 16 bit GOT offset.
    R_390_PC16                             = 16   #! PC relative 16 bit.
    R_390_PC16DBL                          = 17   #! PC relative 16 bit shifted by 1.
    R_390_PLT16DBL                         = 18   #! 16 bit PC rel. PLT shifted by 1.
    R_390_PC32DBL                          = 19   #! PC relative 32 bit shifted by 1.
    R_390_PLT32DBL                         = 20   #! 32 bit PC rel. PLT shifted by 1.
    R_390_GOTPCDBL                         = 21   #! 32 bit PC rel. GOT shifted by 1.
    R_390_64                               = 22   #! Direct 64 bit.
    R_390_PC64                             = 23   #! PC relative 64 bit.
    R_390_GOT64                            = 24   #! 64 bit GOT offset.
    R_390_PLT64                            = 25   #! 64 bit PC relative PLT address.
    R_390_GOTENT                           = 26   #! 32 bit PC rel. to GOT entry >> 1.
    R_390_GOTOFF16                         = 27   #! 16 bit offset to GOT.
    R_390_GOTOFF64                         = 28   #! 64 bit offset to GOT.
    R_390_GOTPLT12                         = 29   #! 12 bit offset to jump slot.
    R_390_GOTPLT16                         = 30   #! 16 bit offset to jump slot.
    R_390_GOTPLT32                         = 31   #! 32 bit offset to jump slot.
    R_390_GOTPLT64                         = 32   #! 64 bit offset to jump slot.
    R_390_GOTPLTENT                        = 33   #! 32 bit rel. offset to jump slot.
    R_390_PLTOFF16                         = 34   #! 16 bit offset from GOT to PLT.
    R_390_PLTOFF32                         = 35   #! 32 bit offset from GOT to PLT.
    R_390_PLTOFF64                         = 36   #! 16 bit offset from GOT to PLT.
    R_390_TLS_LOAD                         = 37   #! Tag for load insn in TLS code.
    R_390_TLS_GDCALL                       = 38   #! Tag for function call in general dynamic TLS code.
    R_390_TLS_LDCALL                       = 39   #! Tag for function call in local dynamic TLS code.
    R_390_TLS_GD32                         = 40   #! Direct 32 bit for general dynamic thread local data.
    R_390_TLS_GD64                         = 41   #! Direct 64 bit for general dynamic thread local data.
    R_390_TLS_GOTIE12                      = 42   #! 12 bit GOT offset for static TLS block offset.
    R_390_TLS_GOTIE32                      = 43   #! 32 bit GOT offset for static TLS block offset.
    R_390_TLS_GOTIE64                      = 44   #! 64 bit GOT offset for static TLS block offset.
    R_390_TLS_LDM32                        = 45   #! Direct 32 bit for local dynamic thread local data in LE code.
    R_390_TLS_LDM64                        = 46   #! Direct 64 bit for local dynamic thread local data in LE code.
    R_390_TLS_IE32                         = 47   #! 32 bit address of GOT entry for negated static TLS block offset.
    R_390_TLS_IE64                         = 48   #! 64 bit address of GOT entry for negated static TLS block offset.
    R_390_TLS_IEENT                        = 49   #! 32 bit rel. offset to GOT entry for negated static TLS block offset.
    R_390_TLS_LE32                         = 50   #! 32 bit negated offset relative to static TLS block.
    R_390_TLS_LE64                         = 51   #! 64 bit negated offset relative to static TLS block.
    R_390_TLS_LDO32                        = 52   #! 32 bit offset relative to TLS block.
    R_390_TLS_LDO64                        = 53   #! 64 bit offset relative to TLS block.
    R_390_TLS_DTPMOD                       = 54   #! ID of module containing symbol.
    R_390_TLS_DTPOFF                       = 55   #! Offset in TLS block.
    R_390_TLS_TPOFF                        = 56   #! Negated offset in static TLS block.
    R_390_20                               = 57   #! Direct 20 bit.
    R_390_GOT20                            = 58   #! 20 bit GOT offset.
    R_390_GOTPLT20                         = 59   #! 20 bit offset to jump slot.
    R_390_TLS_GOTIE20                      = 60   #! 20 bit GOT offset for static TLS block offset.
    R_390_IRELATIVE                        = 61   #! STT_GNU_IFUNC relocation.
    R_390_NUM                              = 62


class RelocsCris(enum.IntEnum):

    R_CRIS_NONE                            = 0
    R_CRIS_8                               = 1
    R_CRIS_16                              = 2
    R_CRIS_32                              = 3
    R_CRIS_8_PCREL                         = 4
    R_CRIS_16_PCREL                        = 5
    R_CRIS_32_PCREL                        = 6
    R_CRIS_GNU_VTINHERIT                   = 7
    R_CRIS_GNU_VTENTRY                     = 8
    R_CRIS_COPY                            = 9
    R_CRIS_GLOB_DAT                        = 10
    R_CRIS_JUMP_SLOT                       = 11
    R_CRIS_RELATIVE                        = 12
    R_CRIS_16_GOT                          = 13
    R_CRIS_32_GOT                          = 14
    R_CRIS_16_GOTPLT                       = 15
    R_CRIS_32_GOTPLT                       = 16
    R_CRIS_32_GOTREL                       = 17
    R_CRIS_32_PLT_GOTREL                   = 18
    R_CRIS_32_PLT_PCREL                    = 19
    R_CRIS_NUM                             = 20


class RelocsX86(enum.IntEnum):

    R_X86_64_NONE                          = 0    #! No reloc
    R_X86_64_64                            = 1    #! Direct 64 bit
    R_X86_64_PC32                          = 2    #! PC relative 32 bit signed
    R_X86_64_GOT32                         = 3    #! 32 bit GOT entry
    R_X86_64_PLT32                         = 4    #! 32 bit PLT address
    R_X86_64_COPY                          = 5    #! Copy symbol at runtime
    R_X86_64_GLOB_DAT                      = 6    #! Create GOT entry
    R_X86_64_JUMP_SLOT                     = 7    #! Create PLT entry
    R_X86_64_RELATIVE                      = 8    #! Adjust by program base
    R_X86_64_GOTPCREL                      = 9    #! 32 bit signed PC relative offset to GOT
    R_X86_64_32                            = 10   #! Direct 32 bit zero extended
    R_X86_64_32S                           = 11   #! Direct 32 bit sign extended
    R_X86_64_16                            = 12   #! Direct 16 bit zero extended
    R_X86_64_PC16                          = 13   #! 16 bit sign extended pc relative
    R_X86_64_8                             = 14   #! Direct 8 bit sign extended
    R_X86_64_PC8                           = 15   #! 8 bit sign extended pc relative
    R_X86_64_DTPMOD64                      = 16   #! ID of module containing symbol
    R_X86_64_DTPOFF64                      = 17   #! Offset in module's TLS block
    R_X86_64_TPOFF64                       = 18   #! Offset in initial TLS block
    R_X86_64_TLSGD                         = 19   #! 32 bit signed PC relative offset to two GOT entries for GD symbol
    R_X86_64_TLSLD                         = 20   #! 32 bit signed PC relative offset to two GOT entries for LD symbol
    R_X86_64_DTPOFF32                      = 21   #! Offset in TLS block
    R_X86_64_GOTTPOFF                      = 22   #! 32 bit signed PC relative offset to GOT entry for IE symbol
    R_X86_64_TPOFF32                       = 23   #! Offset in initial TLS block
    R_X86_64_PC64                          = 24   #! PC relative 64 bit
    R_X86_64_GOTOFF64                      = 25   #! 64 bit offset to GOT
    R_X86_64_GOTPC32                       = 26   #! 32 bit signed pc relative offset to GOT
    R_X86_64_GOT64                         = 27   #! 64-bit GOT entry offset
    R_X86_64_GOTPCREL64                    = 28   #! 64-bit PC relative offset to GOT entry
    R_X86_64_GOTPC64                       = 29   #! 64-bit PC relative offset to GOT
    R_X86_64_GOTPLT64                      = 30   #! like GOT64, says PLT entry needed
    R_X86_64_PLTOFF64                      = 31   #! 64-bit GOT relative offset to PLT entry
    R_X86_64_SIZE32                        = 32   #! Size of symbol plus 32-bit addend
    R_X86_64_SIZE64                        = 33   #! Size of symbol plus 64-bit addend
    R_X86_64_GOTPC32_TLSDESC               = 34   #! GOT offset for TLS descriptor.
    R_X86_64_TLSDESC_CALL                  = 35   #! Marker for call through TLS descriptor.
    R_X86_64_TLSDESC                       = 36   #! TLS descriptor.
    R_X86_64_IRELATIVE                     = 37   #! Adjust indirectly by program base
    R_X86_64_RELATIVE64                    = 38   #! 64-bit adjust by program base
    R_X86_64_GOTPCRELX                     = 41   #! Load from 32 bit signed pc relative offset to GOT entry without REX prefix, relaxable.
    R_X86_64_REX_GOTPCRELX                 = 42   #! Load from 32 bit signed pc relative offset to GOT entry with REX prefix, relaxable.
    R_X86_64_NUM                           = 43


class RelocsMn10300(enum.IntEnum):

    R_MN10300_NONE                         = 0    #! No reloc.
    R_MN10300_32                           = 1    #! Direct 32 bit.
    R_MN10300_16                           = 2    #! Direct 16 bit.
    R_MN10300_8                            = 3    #! Direct 8 bit.
    R_MN10300_PCREL32                      = 4    #! PC-relative 32-bit.
    R_MN10300_PCREL16                      = 5    #! PC-relative 16-bit signed.
    R_MN10300_PCREL8                       = 6    #! PC-relative 8-bit signed.
    R_MN10300_GNU_VTINHERIT                = 7    #! Ancient C++ vtable garbage...
    R_MN10300_GNU_VTENTRY                  = 8    #! ... collection annotation.
    R_MN10300_24                           = 9    #! Direct 24 bit.
    R_MN10300_GOTPC32                      = 10   #! 32-bit PCrel offset to GOT.
    R_MN10300_GOTPC16                      = 11   #! 16-bit PCrel offset to GOT.
    R_MN10300_GOTOFF32                     = 12   #! 32-bit offset from GOT.
    R_MN10300_GOTOFF24                     = 13   #! 24-bit offset from GOT.
    R_MN10300_GOTOFF16                     = 14   #! 16-bit offset from GOT.
    R_MN10300_PLT32                        = 15   #! 32-bit PCrel to PLT entry.
    R_MN10300_PLT16                        = 16   #! 16-bit PCrel to PLT entry.
    R_MN10300_GOT32                        = 17   #! 32-bit offset to GOT entry.
    R_MN10300_GOT24                        = 18   #! 24-bit offset to GOT entry.
    R_MN10300_GOT16                        = 19   #! 16-bit offset to GOT entry.
    R_MN10300_COPY                         = 20   #! Copy symbol at runtime.
    R_MN10300_GLOB_DAT                     = 21   #! Create GOT entry.
    R_MN10300_JMP_SLOT                     = 22   #! Create PLT entry.
    R_MN10300_RELATIVE                     = 23   #! Adjust by program base.
    R_MN10300_TLS_GD                       = 24   #! 32-bit offset for global dynamic.
    R_MN10300_TLS_LD                       = 25   #! 32-bit offset for local dynamic.
    R_MN10300_TLS_LDO                      = 26   #! Module-relative offset.
    R_MN10300_TLS_GOTIE                    = 27   #! GOT offset for static TLS block offset.
    R_MN10300_TLS_IE                       = 28   #! GOT address for static TLS block offset.
    R_MN10300_TLS_LE                       = 29   #! Offset relative to static TLS block.
    R_MN10300_TLS_DTPMOD                   = 30   #! ID of module containing symbol.
    R_MN10300_TLS_DTPOFF                   = 31   #! Offset in module TLS block.
    R_MN10300_TLS_TPOFF                    = 32   #! Offset in static TLS block.
    R_MN10300_SYM_DIFF                     = 33   #! Adjustment for next reloc as needed by linker relaxation.
    R_MN10300_ALIGN                        = 34   #! Alignment requirement for linker relaxation.
    R_MN10300_NUM                          = 35


class RelocsM32R(enum.IntEnum):

    R_M32R_NONE                            = 0    #! No reloc.
    R_M32R_16                              = 1    #! Direct 16 bit.
    R_M32R_32                              = 2    #! Direct 32 bit.
    R_M32R_24                              = 3    #! Direct 24 bit.
    R_M32R_10_PCREL                        = 4    #! PC relative 10 bit shifted.
    R_M32R_18_PCREL                        = 5    #! PC relative 18 bit shifted.
    R_M32R_26_PCREL                        = 6    #! PC relative 26 bit shifted.
    R_M32R_HI16_ULO                        = 7    #! High 16 bit with unsigned low.
    R_M32R_HI16_SLO                        = 8    #! High 16 bit with signed low.
    R_M32R_LO16                            = 9    #! Low 16 bit.
    R_M32R_SDA16                           = 10   #! 16 bit offset in SDA.
    R_M32R_GNU_VTINHERIT                   = 11
    R_M32R_GNU_VTENTRY                     = 12
    R_M32R_16_RELA                         = 33   #! Direct 16 bit.
    R_M32R_32_RELA                         = 34   #! Direct 32 bit.
    R_M32R_24_RELA                         = 35   #! Direct 24 bit.
    R_M32R_10_PCREL_RELA                   = 36   #! PC relative 10 bit shifted.
    R_M32R_18_PCREL_RELA                   = 37   #! PC relative 18 bit shifted.
    R_M32R_26_PCREL_RELA                   = 38   #! PC relative 26 bit shifted.
    R_M32R_HI16_ULO_RELA                   = 39   #! High 16 bit with unsigned low
    R_M32R_HI16_SLO_RELA                   = 40   #! High 16 bit with signed low
    R_M32R_LO16_RELA                       = 41   #! Low 16 bit
    R_M32R_SDA16_RELA                      = 42   #! 16 bit offset in SDA
    R_M32R_RELA_GNU_VTINHERIT              = 43
    R_M32R_RELA_GNU_VTENTRY                = 44
    R_M32R_REL32                           = 45   #! PC relative 32 bit.
    R_M32R_GOT24                           = 48   #! 24 bit GOT entry
    R_M32R_26_PLTREL                       = 49   #! 26 bit PC relative to PLT shifted
    R_M32R_COPY                            = 50   #! Copy symbol at runtime
    R_M32R_GLOB_DAT                        = 51   #! Create GOT entry
    R_M32R_JMP_SLOT                        = 52   #! Create PLT entry
    R_M32R_RELATIVE                        = 53   #! Adjust by program base
    R_M32R_GOTOFF                          = 54   #! 24 bit offset to GOT
    R_M32R_GOTPC24                         = 55   #! 24 bit PC relative offset to GOT
    R_M32R_GOT16_HI_ULO                    = 56   #! High 16 bit GOT entry with unsigned low
    R_M32R_GOT16_HI_SLO                    = 57   #! High 16 bit GOT entry with signed low
    R_M32R_GOT16_LO                        = 58   #! Low 16 bit GOT entry
    R_M32R_GOTPC_HI_ULO                    = 59   #! High 16 bit PC relative offset to GOT with unsigned low
    R_M32R_GOTPC_HI_SLO                    = 60   #! High 16 bit PC relative offset to GOT with signed low
    R_M32R_GOTPC_LO                        = 61   #! Low 16 bit PC relative offset to GOT
    R_M32R_GOTOFF_HI_ULO                   = 62   #! High 16 bit offset to GOT with unsigned low
    R_M32R_GOTOFF_HI_SLO                   = 63   #! High 16 bit offset to GOT with signed low
    R_M32R_GOTOFF_LO                       = 64   #! Low 16 bit offset to GOT
    R_M32R_NUM                             = 256  #! Keep this the last entry.


class RelocsMicroblaze(enum.IntEnum):

    R_MICROBLAZE_NONE                      = 0    #! No reloc.
    R_MICROBLAZE_32                        = 1    #! Direct 32 bit.
    R_MICROBLAZE_32_PCREL                  = 2    #! PC relative 32 bit.
    R_MICROBLAZE_64_PCREL                  = 3    #! PC relative 64 bit.
    R_MICROBLAZE_32_PCREL_LO               = 4    #! Low 16 bits of PCREL32.
    R_MICROBLAZE_64                        = 5    #! Direct 64 bit.
    R_MICROBLAZE_32_LO                     = 6    #! Low 16 bit.
    R_MICROBLAZE_SRO32                     = 7    #! Read-only small data area.
    R_MICROBLAZE_SRW32                     = 8    #! Read-write small data area.
    R_MICROBLAZE_64_NONE                   = 9    #! No reloc.
    R_MICROBLAZE_32_SYM_OP_SYM             = 10   #! Symbol Op Symbol relocation.
    R_MICROBLAZE_GNU_VTINHERIT             = 11   #! GNU C++ vtable hierarchy.
    R_MICROBLAZE_GNU_VTENTRY               = 12   #! GNU C++ vtable member usage.
    R_MICROBLAZE_GOTPC_64                  = 13   #! PC-relative GOT offset.
    R_MICROBLAZE_GOT_64                    = 14   #! GOT entry offset.
    R_MICROBLAZE_PLT_64                    = 15   #! PLT offset (PC-relative).
    R_MICROBLAZE_REL                       = 16   #! Adjust by program base.
    R_MICROBLAZE_JUMP_SLOT                 = 17   #! Create PLT entry.
    R_MICROBLAZE_GLOB_DAT                  = 18   #! Create GOT entry.
    R_MICROBLAZE_GOTOFF_64                 = 19   #! 64 bit offset to GOT.
    R_MICROBLAZE_GOTOFF_32                 = 20   #! 32 bit offset to GOT.
    R_MICROBLAZE_COPY                      = 21   #! Runtime copy.
    R_MICROBLAZE_TLS                       = 22   #! TLS Reloc.
    R_MICROBLAZE_TLSGD                     = 23   #! TLS General Dynamic.
    R_MICROBLAZE_TLSLD                     = 24   #! TLS Local Dynamic.
    R_MICROBLAZE_TLSDTPMOD32               = 25   #! TLS Module ID.
    R_MICROBLAZE_TLSDTPREL32               = 26   #! TLS Offset Within TLS Block.
    R_MICROBLAZE_TLSDTPREL64               = 27   #! TLS Offset Within TLS Block.
    R_MICROBLAZE_TLSGOTTPREL32             = 28   #! TLS Offset From Thread Pointer.
    R_MICROBLAZE_TLSTPREL32                = 29   #! TLS Offset From Thread Pointer.


class RelocsNios2(enum.IntEnum):

    R_NIOS2_NONE                           = 0    #! No reloc.
    R_NIOS2_S16                            = 1    #! Direct signed 16 bit.
    R_NIOS2_U16                            = 2    #! Direct unsigned 16 bit.
    R_NIOS2_PCREL16                        = 3    #! PC relative 16 bit.
    R_NIOS2_CALL26                         = 4    #! Direct call.
    R_NIOS2_IMM5                           = 5    #! 5 bit constant expression.
    R_NIOS2_CACHE_OPX                      = 6    #! 5 bit expression, shift 22.
    R_NIOS2_IMM6                           = 7    #! 6 bit constant expression.
    R_NIOS2_IMM8                           = 8    #! 8 bit constant expression.
    R_NIOS2_HI16                           = 9    #! High 16 bit.
    R_NIOS2_LO16                           = 10   #! Low 16 bit.
    R_NIOS2_HIADJ16                        = 11   #! High 16 bit, adjusted.
    R_NIOS2_BFD_RELOC_32                   = 12   #! 32 bit symbol value + addend.
    R_NIOS2_BFD_RELOC_16                   = 13   #! 16 bit symbol value + addend.
    R_NIOS2_BFD_RELOC_8                    = 14   #! 8 bit symbol value + addend.
    R_NIOS2_GPREL                          = 15   #! 16 bit GP pointer offset.
    R_NIOS2_GNU_VTINHERIT                  = 16   #! GNU C++ vtable hierarchy.
    R_NIOS2_GNU_VTENTRY                    = 17   #! GNU C++ vtable member usage.
    R_NIOS2_UJMP                           = 18   #! Unconditional branch.
    R_NIOS2_CJMP                           = 19   #! Conditional branch.
    R_NIOS2_CALLR                          = 20   #! Indirect call through register.
    R_NIOS2_ALIGN                          = 21   #! Alignment requirement for linker relaxation.
    R_NIOS2_GOT16                          = 22   #! 16 bit GOT entry.
    R_NIOS2_CALL16                         = 23   #! 16 bit GOT entry for function.
    R_NIOS2_GOTOFF_LO                      = 24   #! %lo of offset to GOT pointer.
    R_NIOS2_GOTOFF_HA                      = 25   #! %hiadj of offset to GOT pointer.
    R_NIOS2_PCREL_LO                       = 26   #! %lo of PC relative offset.
    R_NIOS2_PCREL_HA                       = 27   #! %hiadj of PC relative offset.
    R_NIOS2_TLS_GD16                       = 28   #! 16 bit GOT offset for TLS GD.
    R_NIOS2_TLS_LDM16                      = 29   #! 16 bit GOT offset for TLS LDM.
    R_NIOS2_TLS_LDO16                      = 30   #! 16 bit module relative offset.
    R_NIOS2_TLS_IE16                       = 31   #! 16 bit GOT offset for TLS IE.
    R_NIOS2_TLS_LE16                       = 32   #! 16 bit LE TP-relative offset.
    R_NIOS2_TLS_DTPMOD                     = 33   #! Module number.
    R_NIOS2_TLS_DTPREL                     = 34   #! Module-relative offset.
    R_NIOS2_TLS_TPREL                      = 35   #! TP-relative offset.
    R_NIOS2_COPY                           = 36   #! Copy symbol at runtime.
    R_NIOS2_GLOB_DAT                       = 37   #! Create GOT entry.
    R_NIOS2_JUMP_SLOT                      = 38   #! Create PLT entry.
    R_NIOS2_RELATIVE                       = 39   #! Adjust by program base.
    R_NIOS2_GOTOFF                         = 40   #! 16 bit offset to GOT pointer.
    R_NIOS2_CALL26_NOAT                    = 41   #! Direct call in .noat section.
    R_NIOS2_GOT_LO                         = 42   #! %lo() of GOT entry.
    R_NIOS2_GOT_HA                         = 43   #! %hiadj() of GOT entry.
    R_NIOS2_CALL_LO                        = 44   #! %lo() of function GOT entry.
    R_NIOS2_CALL_HA                        = 45   #! %hiadj() of function GOT entry.


class RelocsTilepro(enum.IntEnum):

    R_TILEPRO_NONE                         = 0    #! No reloc
    R_TILEPRO_32                           = 1    #! Direct 32 bit
    R_TILEPRO_16                           = 2    #! Direct 16 bit
    R_TILEPRO_8                            = 3    #! Direct 8 bit
    R_TILEPRO_32_PCREL                     = 4    #! PC relative 32 bit
    R_TILEPRO_16_PCREL                     = 5    #! PC relative 16 bit
    R_TILEPRO_8_PCREL                      = 6    #! PC relative 8 bit
    R_TILEPRO_LO16                         = 7    #! Low 16 bit
    R_TILEPRO_HI16                         = 8    #! High 16 bit
    R_TILEPRO_HA16                         = 9    #! High 16 bit, adjusted
    R_TILEPRO_COPY                         = 10   #! Copy relocation
    R_TILEPRO_GLOB_DAT                     = 11   #! Create GOT entry
    R_TILEPRO_JMP_SLOT                     = 12   #! Create PLT entry
    R_TILEPRO_RELATIVE                     = 13   #! Adjust by program base
    R_TILEPRO_BROFF_X1                     = 14   #! X1 pipe branch offset
    R_TILEPRO_JOFFLONG_X1                  = 15   #! X1 pipe jump offset
    R_TILEPRO_JOFFLONG_X1_PLT              = 16   #! X1 pipe jump offset to PLT
    R_TILEPRO_IMM8_X0                      = 17   #! X0 pipe 8-bit
    R_TILEPRO_IMM8_Y0                      = 18   #! Y0 pipe 8-bit
    R_TILEPRO_IMM8_X1                      = 19   #! X1 pipe 8-bit
    R_TILEPRO_IMM8_Y1                      = 20   #! Y1 pipe 8-bit
    R_TILEPRO_MT_IMM15_X1                  = 21   #! X1 pipe mtspr
    R_TILEPRO_MF_IMM15_X1                  = 22   #! X1 pipe mfspr
    R_TILEPRO_IMM16_X0                     = 23   #! X0 pipe 16-bit
    R_TILEPRO_IMM16_X1                     = 24   #! X1 pipe 16-bit
    R_TILEPRO_IMM16_X0_LO                  = 25   #! X0 pipe low 16-bit
    R_TILEPRO_IMM16_X1_LO                  = 26   #! X1 pipe low 16-bit
    R_TILEPRO_IMM16_X0_HI                  = 27   #! X0 pipe high 16-bit
    R_TILEPRO_IMM16_X1_HI                  = 28   #! X1 pipe high 16-bit
    R_TILEPRO_IMM16_X0_HA                  = 29   #! X0 pipe high 16-bit, adjusted
    R_TILEPRO_IMM16_X1_HA                  = 30   #! X1 pipe high 16-bit, adjusted
    R_TILEPRO_IMM16_X0_PCREL               = 31   #! X0 pipe PC relative 16 bit
    R_TILEPRO_IMM16_X1_PCREL               = 32   #! X1 pipe PC relative 16 bit
    R_TILEPRO_IMM16_X0_LO_PCREL            = 33   #! X0 pipe PC relative low 16 bit
    R_TILEPRO_IMM16_X1_LO_PCREL            = 34   #! X1 pipe PC relative low 16 bit
    R_TILEPRO_IMM16_X0_HI_PCREL            = 35   #! X0 pipe PC relative high 16 bit
    R_TILEPRO_IMM16_X1_HI_PCREL            = 36   #! X1 pipe PC relative high 16 bit
    R_TILEPRO_IMM16_X0_HA_PCREL            = 37   #! X0 pipe PC relative ha() 16 bit
    R_TILEPRO_IMM16_X1_HA_PCREL            = 38   #! X1 pipe PC relative ha() 16 bit
    R_TILEPRO_IMM16_X0_GOT                 = 39   #! X0 pipe 16-bit GOT offset
    R_TILEPRO_IMM16_X1_GOT                 = 40   #! X1 pipe 16-bit GOT offset
    R_TILEPRO_IMM16_X0_GOT_LO              = 41   #! X0 pipe low 16-bit GOT offset
    R_TILEPRO_IMM16_X1_GOT_LO              = 42   #! X1 pipe low 16-bit GOT offset
    R_TILEPRO_IMM16_X0_GOT_HI              = 43   #! X0 pipe high 16-bit GOT offset
    R_TILEPRO_IMM16_X1_GOT_HI              = 44   #! X1 pipe high 16-bit GOT offset
    R_TILEPRO_IMM16_X0_GOT_HA              = 45   #! X0 pipe ha() 16-bit GOT offset
    R_TILEPRO_IMM16_X1_GOT_HA              = 46   #! X1 pipe ha() 16-bit GOT offset
    R_TILEPRO_MMSTART_X0                   = 47   #! X0 pipe mm "start"
    R_TILEPRO_MMEND_X0                     = 48   #! X0 pipe mm "end"
    R_TILEPRO_MMSTART_X1                   = 49   #! X1 pipe mm "start"
    R_TILEPRO_MMEND_X1                     = 50   #! X1 pipe mm "end"
    R_TILEPRO_SHAMT_X0                     = 51   #! X0 pipe shift amount
    R_TILEPRO_SHAMT_X1                     = 52   #! X1 pipe shift amount
    R_TILEPRO_SHAMT_Y0                     = 53   #! Y0 pipe shift amount
    R_TILEPRO_SHAMT_Y1                     = 54   #! Y1 pipe shift amount
    R_TILEPRO_DEST_IMM8_X1                 = 55   #! X1 pipe destination 8-bit
    R_TILEPRO_TLS_GD_CALL                  = 60   #! "jal" for TLS GD
    R_TILEPRO_IMM8_X0_TLS_GD_ADD           = 61   #! X0 pipe "addi" for TLS GD
    R_TILEPRO_IMM8_X1_TLS_GD_ADD           = 62   #! X1 pipe "addi" for TLS GD
    R_TILEPRO_IMM8_Y0_TLS_GD_ADD           = 63   #! Y0 pipe "addi" for TLS GD
    R_TILEPRO_IMM8_Y1_TLS_GD_ADD           = 64   #! Y1 pipe "addi" for TLS GD
    R_TILEPRO_TLS_IE_LOAD                  = 65   #! "lw_tls" for TLS IE
    R_TILEPRO_IMM16_X0_TLS_GD              = 66   #! X0 pipe 16-bit TLS GD offset
    R_TILEPRO_IMM16_X1_TLS_GD              = 67   #! X1 pipe 16-bit TLS GD offset
    R_TILEPRO_IMM16_X0_TLS_GD_LO           = 68   #! X0 pipe low 16-bit TLS GD offset
    R_TILEPRO_IMM16_X1_TLS_GD_LO           = 69   #! X1 pipe low 16-bit TLS GD offset
    R_TILEPRO_IMM16_X0_TLS_GD_HI           = 70   #! X0 pipe high 16-bit TLS GD offset
    R_TILEPRO_IMM16_X1_TLS_GD_HI           = 71   #! X1 pipe high 16-bit TLS GD offset
    R_TILEPRO_IMM16_X0_TLS_GD_HA           = 72   #! X0 pipe ha() 16-bit TLS GD offset
    R_TILEPRO_IMM16_X1_TLS_GD_HA           = 73   #! X1 pipe ha() 16-bit TLS GD offset
    R_TILEPRO_IMM16_X0_TLS_IE              = 74   #! X0 pipe 16-bit TLS IE offset
    R_TILEPRO_IMM16_X1_TLS_IE              = 75   #! X1 pipe 16-bit TLS IE offset
    R_TILEPRO_IMM16_X0_TLS_IE_LO           = 76   #! X0 pipe low 16-bit TLS IE offset
    R_TILEPRO_IMM16_X1_TLS_IE_LO           = 77   #! X1 pipe low 16-bit TLS IE offset
    R_TILEPRO_IMM16_X0_TLS_IE_HI           = 78   #! X0 pipe high 16-bit TLS IE offset
    R_TILEPRO_IMM16_X1_TLS_IE_HI           = 79   #! X1 pipe high 16-bit TLS IE offset
    R_TILEPRO_IMM16_X0_TLS_IE_HA           = 80   #! X0 pipe ha() 16-bit TLS IE offset
    R_TILEPRO_IMM16_X1_TLS_IE_HA           = 81   #! X1 pipe ha() 16-bit TLS IE offset
    R_TILEPRO_TLS_DTPMOD32                 = 82   #! ID of module containing symbol
    R_TILEPRO_TLS_DTPOFF32                 = 83   #! Offset in TLS block
    R_TILEPRO_TLS_TPOFF32                  = 84   #! Offset in static TLS block
    R_TILEPRO_IMM16_X0_TLS_LE              = 85   #! X0 pipe 16-bit TLS LE offset
    R_TILEPRO_IMM16_X1_TLS_LE              = 86   #! X1 pipe 16-bit TLS LE offset
    R_TILEPRO_IMM16_X0_TLS_LE_LO           = 87   #! X0 pipe low 16-bit TLS LE offset
    R_TILEPRO_IMM16_X1_TLS_LE_LO           = 88   #! X1 pipe low 16-bit TLS LE offset
    R_TILEPRO_IMM16_X0_TLS_LE_HI           = 89   #! X0 pipe high 16-bit TLS LE offset
    R_TILEPRO_IMM16_X1_TLS_LE_HI           = 90   #! X1 pipe high 16-bit TLS LE offset
    R_TILEPRO_IMM16_X0_TLS_LE_HA           = 91   #! X0 pipe ha() 16-bit TLS LE offset
    R_TILEPRO_IMM16_X1_TLS_LE_HA           = 92   #! X1 pipe ha() 16-bit TLS LE offset
    R_TILEPRO_GNU_VTINHERIT                = 128  #! GNU C++ vtable hierarchy
    R_TILEPRO_GNU_VTENTRY                  = 129  #! GNU C++ vtable member usage
    R_TILEPRO_NUM                          = 130


class RelocsTilegx(enum.IntEnum):

    R_TILEGX_NONE                          = 0    #! No reloc
    R_TILEGX_64                            = 1    #! Direct 64 bit
    R_TILEGX_32                            = 2    #! Direct 32 bit
    R_TILEGX_16                            = 3    #! Direct 16 bit
    R_TILEGX_8                             = 4    #! Direct 8 bit
    R_TILEGX_64_PCREL                      = 5    #! PC relative 64 bit
    R_TILEGX_32_PCREL                      = 6    #! PC relative 32 bit
    R_TILEGX_16_PCREL                      = 7    #! PC relative 16 bit
    R_TILEGX_8_PCREL                       = 8    #! PC relative 8 bit
    R_TILEGX_HW0                           = 9    #! hword 0 16-bit
    R_TILEGX_HW1                           = 10   #! hword 1 16-bit
    R_TILEGX_HW2                           = 11   #! hword 2 16-bit
    R_TILEGX_HW3                           = 12   #! hword 3 16-bit
    R_TILEGX_HW0_LAST                      = 13   #! last hword 0 16-bit
    R_TILEGX_HW1_LAST                      = 14   #! last hword 1 16-bit
    R_TILEGX_HW2_LAST                      = 15   #! last hword 2 16-bit
    R_TILEGX_COPY                          = 16   #! Copy relocation
    R_TILEGX_GLOB_DAT                      = 17   #! Create GOT entry
    R_TILEGX_JMP_SLOT                      = 18   #! Create PLT entry
    R_TILEGX_RELATIVE                      = 19   #! Adjust by program base
    R_TILEGX_BROFF_X1                      = 20   #! X1 pipe branch offset
    R_TILEGX_JUMPOFF_X1                    = 21   #! X1 pipe jump offset
    R_TILEGX_JUMPOFF_X1_PLT                = 22   #! X1 pipe jump offset to PLT
    R_TILEGX_IMM8_X0                       = 23   #! X0 pipe 8-bit
    R_TILEGX_IMM8_Y0                       = 24   #! Y0 pipe 8-bit
    R_TILEGX_IMM8_X1                       = 25   #! X1 pipe 8-bit
    R_TILEGX_IMM8_Y1                       = 26   #! Y1 pipe 8-bit
    R_TILEGX_DEST_IMM8_X1                  = 27   #! X1 pipe destination 8-bit
    R_TILEGX_MT_IMM14_X1                   = 28   #! X1 pipe mtspr
    R_TILEGX_MF_IMM14_X1                   = 29   #! X1 pipe mfspr
    R_TILEGX_MMSTART_X0                    = 30   #! X0 pipe mm "start"
    R_TILEGX_MMEND_X0                      = 31   #! X0 pipe mm "end"
    R_TILEGX_SHAMT_X0                      = 32   #! X0 pipe shift amount
    R_TILEGX_SHAMT_X1                      = 33   #! X1 pipe shift amount
    R_TILEGX_SHAMT_Y0                      = 34   #! Y0 pipe shift amount
    R_TILEGX_SHAMT_Y1                      = 35   #! Y1 pipe shift amount
    R_TILEGX_IMM16_X0_HW0                  = 36   #! X0 pipe hword 0
    R_TILEGX_IMM16_X1_HW0                  = 37   #! X1 pipe hword 0
    R_TILEGX_IMM16_X0_HW1                  = 38   #! X0 pipe hword 1
    R_TILEGX_IMM16_X1_HW1                  = 39   #! X1 pipe hword 1
    R_TILEGX_IMM16_X0_HW2                  = 40   #! X0 pipe hword 2
    R_TILEGX_IMM16_X1_HW2                  = 41   #! X1 pipe hword 2
    R_TILEGX_IMM16_X0_HW3                  = 42   #! X0 pipe hword 3
    R_TILEGX_IMM16_X1_HW3                  = 43   #! X1 pipe hword 3
    R_TILEGX_IMM16_X0_HW0_LAST             = 44   #! X0 pipe last hword 0
    R_TILEGX_IMM16_X1_HW0_LAST             = 45   #! X1 pipe last hword 0
    R_TILEGX_IMM16_X0_HW1_LAST             = 46   #! X0 pipe last hword 1
    R_TILEGX_IMM16_X1_HW1_LAST             = 47   #! X1 pipe last hword 1
    R_TILEGX_IMM16_X0_HW2_LAST             = 48   #! X0 pipe last hword 2
    R_TILEGX_IMM16_X1_HW2_LAST             = 49   #! X1 pipe last hword 2
    R_TILEGX_IMM16_X0_HW0_PCREL            = 50   #! X0 pipe PC relative hword 0
    R_TILEGX_IMM16_X1_HW0_PCREL            = 51   #! X1 pipe PC relative hword 0
    R_TILEGX_IMM16_X0_HW1_PCREL            = 52   #! X0 pipe PC relative hword 1
    R_TILEGX_IMM16_X1_HW1_PCREL            = 53   #! X1 pipe PC relative hword 1
    R_TILEGX_IMM16_X0_HW2_PCREL            = 54   #! X0 pipe PC relative hword 2
    R_TILEGX_IMM16_X1_HW2_PCREL            = 55   #! X1 pipe PC relative hword 2
    R_TILEGX_IMM16_X0_HW3_PCREL            = 56   #! X0 pipe PC relative hword 3
    R_TILEGX_IMM16_X1_HW3_PCREL            = 57   #! X1 pipe PC relative hword 3
    R_TILEGX_IMM16_X0_HW0_LAST_PCREL       = 58   #! X0 pipe PC-rel last hword 0
    R_TILEGX_IMM16_X1_HW0_LAST_PCREL       = 59   #! X1 pipe PC-rel last hword 0
    R_TILEGX_IMM16_X0_HW1_LAST_PCREL       = 60   #! X0 pipe PC-rel last hword 1
    R_TILEGX_IMM16_X1_HW1_LAST_PCREL       = 61   #! X1 pipe PC-rel last hword 1
    R_TILEGX_IMM16_X0_HW2_LAST_PCREL       = 62   #! X0 pipe PC-rel last hword 2
    R_TILEGX_IMM16_X1_HW2_LAST_PCREL       = 63   #! X1 pipe PC-rel last hword 2
    R_TILEGX_IMM16_X0_HW0_GOT              = 64   #! X0 pipe hword 0 GOT offset
    R_TILEGX_IMM16_X1_HW0_GOT              = 65   #! X1 pipe hword 0 GOT offset
    R_TILEGX_IMM16_X0_HW0_PLT_PCREL        = 66   #! X0 pipe PC-rel PLT hword 0
    R_TILEGX_IMM16_X1_HW0_PLT_PCREL        = 67   #! X1 pipe PC-rel PLT hword 0
    R_TILEGX_IMM16_X0_HW1_PLT_PCREL        = 68   #! X0 pipe PC-rel PLT hword 1
    R_TILEGX_IMM16_X1_HW1_PLT_PCREL        = 69   #! X1 pipe PC-rel PLT hword 1
    R_TILEGX_IMM16_X0_HW2_PLT_PCREL        = 70   #! X0 pipe PC-rel PLT hword 2
    R_TILEGX_IMM16_X1_HW2_PLT_PCREL        = 71   #! X1 pipe PC-rel PLT hword 2
    R_TILEGX_IMM16_X0_HW0_LAST_GOT         = 72   #! X0 pipe last hword 0 GOT offset
    R_TILEGX_IMM16_X1_HW0_LAST_GOT         = 73   #! X1 pipe last hword 0 GOT offset
    R_TILEGX_IMM16_X0_HW1_LAST_GOT         = 74   #! X0 pipe last hword 1 GOT offset
    R_TILEGX_IMM16_X1_HW1_LAST_GOT         = 75   #! X1 pipe last hword 1 GOT offset
    R_TILEGX_IMM16_X0_HW3_PLT_PCREL        = 76   #! X0 pipe PC-rel PLT hword 3
    R_TILEGX_IMM16_X1_HW3_PLT_PCREL        = 77   #! X1 pipe PC-rel PLT hword 3
    R_TILEGX_IMM16_X0_HW0_TLS_GD           = 78   #! X0 pipe hword 0 TLS GD offset
    R_TILEGX_IMM16_X1_HW0_TLS_GD           = 79   #! X1 pipe hword 0 TLS GD offset
    R_TILEGX_IMM16_X0_HW0_TLS_LE           = 80   #! X0 pipe hword 0 TLS LE offset
    R_TILEGX_IMM16_X1_HW0_TLS_LE           = 81   #! X1 pipe hword 0 TLS LE offset
    R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE      = 82   #! X0 pipe last hword 0 LE off
    R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE      = 83   #! X1 pipe last hword 0 LE off
    R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE      = 84   #! X0 pipe last hword 1 LE off
    R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE      = 85   #! X1 pipe last hword 1 LE off
    R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD      = 86   #! X0 pipe last hword 0 GD off
    R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD      = 87   #! X1 pipe last hword 0 GD off
    R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD      = 88   #! X0 pipe last hword 1 GD off
    R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD      = 89   #! X1 pipe last hword 1 GD off
    R_TILEGX_IMM16_X0_HW0_TLS_IE           = 92   #! X0 pipe hword 0 TLS IE offset
    R_TILEGX_IMM16_X1_HW0_TLS_IE           = 93   #! X1 pipe hword 0 TLS IE offset
    R_TILEGX_IMM16_X0_HW0_LAST_PLT_PCREL   = 94   #! X0 pipe PC-rel PLT last hword 0
    R_TILEGX_IMM16_X1_HW0_LAST_PLT_PCREL   = 95   #! X1 pipe PC-rel PLT last hword 0
    R_TILEGX_IMM16_X0_HW1_LAST_PLT_PCREL   = 96   #! X0 pipe PC-rel PLT last hword 1
    R_TILEGX_IMM16_X1_HW1_LAST_PLT_PCREL   = 97   #! X1 pipe PC-rel PLT last hword 1
    R_TILEGX_IMM16_X0_HW2_LAST_PLT_PCREL   = 98   #! X0 pipe PC-rel PLT last hword 2
    R_TILEGX_IMM16_X1_HW2_LAST_PLT_PCREL   = 99   #! X1 pipe PC-rel PLT last hword 2
    R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE      = 100  #! X0 pipe last hword 0 IE off
    R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE      = 101  #! X1 pipe last hword 0 IE off
    R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE      = 102  #! X0 pipe last hword 1 IE off
    R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE      = 103  #! X1 pipe last hword 1 IE off
    R_TILEGX_TLS_DTPMOD64                  = 106  #! 64-bit ID of symbol's module
    R_TILEGX_TLS_DTPOFF64                  = 107  #! 64-bit offset in TLS block
    R_TILEGX_TLS_TPOFF64                   = 108  #! 64-bit offset in static TLS block
    R_TILEGX_TLS_DTPMOD32                  = 109  #! 32-bit ID of symbol's module
    R_TILEGX_TLS_DTPOFF32                  = 110  #! 32-bit offset in TLS block
    R_TILEGX_TLS_TPOFF32                   = 111  #! 32-bit offset in static TLS block
    R_TILEGX_TLS_GD_CALL                   = 112  #! "jal" for TLS GD
    R_TILEGX_IMM8_X0_TLS_GD_ADD            = 113  #! X0 pipe "addi" for TLS GD
    R_TILEGX_IMM8_X1_TLS_GD_ADD            = 114  #! X1 pipe "addi" for TLS GD
    R_TILEGX_IMM8_Y0_TLS_GD_ADD            = 115  #! Y0 pipe "addi" for TLS GD
    R_TILEGX_IMM8_Y1_TLS_GD_ADD            = 116  #! Y1 pipe "addi" for TLS GD
    R_TILEGX_TLS_IE_LOAD                   = 117  #! "ld_tls" for TLS IE
    R_TILEGX_IMM8_X0_TLS_ADD               = 118  #! X0 pipe "addi" for TLS GD/IE
    R_TILEGX_IMM8_X1_TLS_ADD               = 119  #! X1 pipe "addi" for TLS GD/IE
    R_TILEGX_IMM8_Y0_TLS_ADD               = 120  #! Y0 pipe "addi" for TLS GD/IE
    R_TILEGX_IMM8_Y1_TLS_ADD               = 121  #! Y1 pipe "addi" for TLS GD/IE
    R_TILEGX_GNU_VTINHERIT                 = 128  #! GNU C++ vtable hierarchy
    R_TILEGX_GNU_VTENTRY                   = 129  #! GNU C++ vtable member usage
    R_TILEGX_NUM                           = 130


RelocationMap = {
    ELFMachineType.EM_68K:          Relocs68K,
    ELFMachineType.EM_386:          Relocs386,
    ELFMachineType.EM_SPARC:        RelocsSparc,
    ELFMachineType.EM_SPARC32PLUS:  RelocsSparc,
    ELFMachineType.EM_SPARCV9:      RelocsSparc,
    ELFMachineType.EM_MIPS:         RelocsMips,
    ELFMachineType.EM_MIPS_RS3_LE:  RelocsMips,
    ELFMachineType.EM_MIPS_X:       RelocsMips,
    ELFMachineType.EM_PARISC:       RelocsParisc,
    ELFMachineType.EM_ALPHA:        RelocsAlpha,
    ELFMachineType.EM_ALPHA_NO_ABI: RelocsAlpha,
    ELFMachineType.EM_ALPHA:        RelocsAlpha,
    ELFMachineType.EM_PPC:          RelocsPpc,
    ELFMachineType.EM_PPC64:        RelocsPpc64,
    ELFMachineType.EM_AARCH64:      RelocsAarch64,
    ELFMachineType.EM_ARM:          RelocsArm,
    ELFMachineType.EM_SH:           RelocsSh,
    ELFMachineType.EM_S390:         Relocs390,
    ELFMachineType.EM_CRIS:         RelocsCris,
    ELFMachineType.EM_X86_64:       RelocsX86,
    ELFMachineType.EM_MN10300:      RelocsMn10300,
    ELFMachineType.EM_MN10200:      RelocsMn10300,
    ELFMachineType.EM_M32R:         RelocsM32R,
    ELFMachineType.EM_MICROBLAZE:   RelocsMicroblaze,
    ELFMachineType.EM_ALTERA_NIOS2: RelocsNios2,
    ELFMachineType.EM_TILEPRO:      RelocsTilepro,
    ELFMachineType.EM_TILEGX:       RelocsTilegx,
}

